mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
adding shuffle to songs page
This commit is contained in:
parent
543331b059
commit
e9bac09bd6
2 changed files with 9 additions and 0 deletions
|
@ -92,6 +92,7 @@
|
||||||
<div class="pageTabContent" id="songsTab" data-index="5">
|
<div class="pageTabContent" id="songsTab" data-index="5">
|
||||||
<div class="flex align-items-center justify-content-center flex-wrap-wrap padded-top padded-left padded-right padded-bottom focuscontainer-x">
|
<div class="flex align-items-center justify-content-center flex-wrap-wrap padded-top padded-left padded-right padded-bottom focuscontainer-x">
|
||||||
<div class="paging"></div>
|
<div class="paging"></div>
|
||||||
|
<button is="paper-icon-button-light" class="btnShuffle autoSize" title="${Shuffle}"><span class="material-icons shuffle" aria-hidden="true"></span></button>
|
||||||
<button is="paper-icon-button-light" class="btnSort autoSize" title="${Sort}"><span class="material-icons sort_by_alpha" aria-hidden="true"></span></button>
|
<button is="paper-icon-button-light" class="btnSort autoSize" title="${Sort}"><span class="material-icons sort_by_alpha" aria-hidden="true"></span></button>
|
||||||
<button is="paper-icon-button-light" class="btnFilter autoSize" title="${Filter}"><span class="material-icons filter_list" aria-hidden="true"></span></button>
|
<button is="paper-icon-button-light" class="btnFilter autoSize" title="${Filter}"><span class="material-icons filter_list" aria-hidden="true"></span></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,6 +8,7 @@ import * as userSettings from '../../scripts/settings/userSettings';
|
||||||
import globalize from '../../scripts/globalize';
|
import globalize from '../../scripts/globalize';
|
||||||
import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||||
import Dashboard from '../../utils/dashboard';
|
import Dashboard from '../../utils/dashboard';
|
||||||
|
import {playbackManager} from '../../components/playback/playbackmanager';
|
||||||
|
|
||||||
export default function (view, params, tabContent) {
|
export default function (view, params, tabContent) {
|
||||||
function getPageData(context) {
|
function getPageData(context) {
|
||||||
|
@ -144,6 +145,12 @@ export default function (view, params, tabContent) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function shuffle() {
|
||||||
|
ApiClient.getItem(ApiClient.getCurrentUserId(), params.topParentId).then(function (item) {
|
||||||
|
playbackManager.shuffle(item);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
self.getCurrentViewStyle = function () {
|
self.getCurrentViewStyle = function () {
|
||||||
return getPageData(tabContent).view;
|
return getPageData(tabContent).view;
|
||||||
};
|
};
|
||||||
|
@ -190,6 +197,7 @@ export default function (view, params, tabContent) {
|
||||||
button: e.target
|
button: e.target
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
tabContent.querySelector('.btnShuffle').addEventListener('click', shuffle);
|
||||||
}
|
}
|
||||||
|
|
||||||
initPage(tabContent);
|
initPage(tabContent);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue