Skip to content

Commit

Permalink
Change channel mapper to sort list
Browse files Browse the repository at this point in the history
  • Loading branch information
petermcneil committed Jun 23, 2019
1 parent 6a0672a commit d7180c2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 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
25 changes: 14 additions & 11 deletions src/components/channelmapper/channelmapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,20 @@ define(["dialogHelper", "loading", "connectionManager", "globalize", "actionshee
}

function onChannelsElementClick(e) {
var btnMap = parentWithClass(e.target, "btnMap");
const 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()
}
});
const channelId = btnMap.getAttribute("data-id");
const providerChannelId = btnMap.getAttribute("data-providerid");
const 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 d7180c2

Please sign in to comment.