Skip to content

Commit

Permalink
Merge pull request #364 from petermcneil/channelmapper-sorting
Browse files Browse the repository at this point in the history
Change channel mapper to sort list
  • Loading branch information
dkanada authored Jun 26, 2019
2 parents 6a0672a + f7376f5 commit c9e70d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
23 changes: 13 additions & 10 deletions src/components/channelmapper/channelmapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -93,4 +96,4 @@ define(["dialogHelper", "loading", "connectionManager", "globalize", "actionshee
})
}
}
});
});

0 comments on commit c9e70d9

Please sign in to comment.