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

update form

This commit is contained in:
Luke Pulverenti 2016-04-14 22:58:51 -04:00
parent 8a5107f748
commit 799e86de4a
2 changed files with 16 additions and 13 deletions

View file

@ -4,17 +4,15 @@
function fillItems(elem, items, cssClass, idPrefix, currentList, isEnabledList) {
var html = '<div data-role="controlgroup">';
var html = '<div class="paperCheckboxList paperList" style="padding: .5em 1em;">';
html += items.map(function (u) {
var id = idPrefix + u.Id;
var isChecked = isEnabledList ? currentList.indexOf(u.Id) != -1 : currentList.indexOf(u.Id) == -1;
var checkedHtml = isChecked ? ' checked="checked"' : '';
return '<label for="' + id + '">' + u.Name + '</label><input class="' + cssClass + '" type="checkbox" data-itemid="' + u.Id + '" id="' + id + '"' + checkedHtml + ' />';
return '<paper-checkbox class="' + cssClass + '" type="checkbox" data-itemid="' + u.Id + '"' + checkedHtml + '>' + u.Name + '</paper-checkbox>';
}).join('');
@ -86,7 +84,7 @@
fillItems($('.sendToUsersList', page), users, 'chkSendTo', 'chkSendTo', notificationConfig.SendToUsers, true);
fillItems($('.servicesList', page), services, 'chkService', 'chkService', notificationConfig.DisabledServices);
$('#chkEnabled', page).checked(notificationConfig.Enabled || false).checkboxradio('refresh');
$('#chkEnabled', page).checked(notificationConfig.Enabled || false);
$('#txtTitle', page).val(notificationConfig.Title || typeInfo.DefaultTitle);
@ -135,15 +133,21 @@
notificationConfig.Title = null;
}
notificationConfig.DisabledMonitorUsers = $('.chkMonitor:not(:checked)', page).get().map(function (c) {
notificationConfig.DisabledMonitorUsers = $('.chkMonitor', page).get().filter(function (c) {
return !c.checked;
}).map(function (c) {
return c.getAttribute('data-itemid');
});
notificationConfig.SendToUsers = $('.chkSendTo:checked', page).get().map(function (c) {
notificationConfig.SendToUsers = $('.chkSendTo', page).get().filter(function (c) {
return c.checked;
}).map(function (c) {
return c.getAttribute('data-itemid');
});
notificationConfig.DisabledServices = $('.chkService:not(:checked)', page).get().map(function (c) {
notificationConfig.DisabledServices = $('.chkService', page).get().filter(function (c) {
return !c.checked;
}).map(function (c) {
return c.getAttribute('data-itemid');
});