Merge pull request #364 from petermcneil/channelmapper-sorting

Change channel mapper to sort list
This commit is contained in:
dkanada 2019-06-26 01:22:47 -07:00 committed by GitHub
commit c9e70d9564
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 10 deletions

View file

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

View file

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