mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
Merge pull request #3741 from murphy52589/shuffle-all-songs
Add shuffle to songs page
This commit is contained in:
commit
0e49497b46
@ -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,8 +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';
|
||||||
/* eslint-disable indent */
|
|
||||||
|
|
||||||
export default function (view, params, tabContent) {
|
export default function (view, params, tabContent) {
|
||||||
function getPageData(context) {
|
function getPageData(context) {
|
||||||
@ -118,6 +117,9 @@ import Dashboard from '../../utils/dashboard';
|
|||||||
itemsContainer.innerHTML = html;
|
itemsContainer.innerHTML = html;
|
||||||
imageLoader.lazyChildren(itemsContainer);
|
imageLoader.lazyChildren(itemsContainer);
|
||||||
libraryBrowser.saveQueryValues(getSavedQueryKey(page), query);
|
libraryBrowser.saveQueryValues(getSavedQueryKey(page), query);
|
||||||
|
|
||||||
|
tabContent.querySelector('.btnShuffle').classList.toggle('hide', result.TotalRecordCount < 1);
|
||||||
|
|
||||||
loading.hide();
|
loading.hide();
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
|
||||||
@ -146,6 +148,12 @@ import Dashboard from '../../utils/dashboard';
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
};
|
};
|
||||||
@ -192,6 +200,7 @@ import Dashboard from '../../utils/dashboard';
|
|||||||
button: e.target
|
button: e.target
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
tabContent.querySelector('.btnShuffle').addEventListener('click', shuffle);
|
||||||
}
|
}
|
||||||
|
|
||||||
initPage(tabContent);
|
initPage(tabContent);
|
||||||
@ -200,5 +209,3 @@ import Dashboard from '../../utils/dashboard';
|
|||||||
reloadItems(tabContent);
|
reloadItems(tabContent);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-enable indent */
|
|
||||||
|
Loading…
Reference in New Issue
Block a user