1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Change channel mapper to sort list

This commit is contained in:
petermcneil 2019-06-23 16:54:13 +01:00
parent 6a0672a996
commit d7180c21ca
No known key found for this signature in database
GPG key ID: D6F26AA044850705
2 changed files with 15 additions and 11 deletions

View file

@ -22,6 +22,7 @@
- [LogicalPhallacy](https://github.com/LogicalPhallacy) - [LogicalPhallacy](https://github.com/LogicalPhallacy)
- [thornbill](https://github.com/thornbill) - [thornbill](https://github.com/thornbill)
- [Oddstr13](https://github.com/oddstr13) - [Oddstr13](https://github.com/oddstr13)
- [petermcneil](https://github.com/petermcneil)
# Emby Contributors # Emby Contributors

View file

@ -26,17 +26,20 @@ define(["dialogHelper", "loading", "connectionManager", "globalize", "actionshee
} }
function onChannelsElementClick(e) { function onChannelsElementClick(e) {
var btnMap = parentWithClass(e.target, "btnMap"); const btnMap = parentWithClass(e.target, "btnMap");
if (btnMap) { if (btnMap) {
var channelId = btnMap.getAttribute("data-id"), const channelId = btnMap.getAttribute("data-id");
providerChannelId = btnMap.getAttribute("data-providerid"), const providerChannelId = btnMap.getAttribute("data-providerid");
menuItems = currentMappingOptions.ProviderChannels.map(function(m) { const menuItems = currentMappingOptions.ProviderChannels.map(function(m) {
return { return {
name: m.Name, name: m.Name,
id: m.Id, id: m.Id,
selected: m.Id.toLowerCase() === providerChannelId.toLowerCase() selected: m.Id.toLowerCase() === providerChannelId.toLowerCase()
} }
}); }).sort(function (a, b) {
return a.name.localeCompare(b.name);
});
actionsheet.show({ actionsheet.show({
positionTo: btnMap, positionTo: btnMap,
items: menuItems items: menuItems
@ -93,4 +96,4 @@ define(["dialogHelper", "loading", "connectionManager", "globalize", "actionshee
}) })
} }
} }
}); });