diff --git a/src/controllers/dashboard/plugins/repositories.js b/src/controllers/dashboard/plugins/repositories.js index 3b87dc17ce..a4d6d886e0 100644 --- a/src/controllers/dashboard/plugins/repositories.js +++ b/src/controllers/dashboard/plugins/repositories.js @@ -12,17 +12,6 @@ let repositories = []; function reloadList(page) { loading.show(); - - if (repositories.length) { - populateList({ - listElement: page.querySelector('#repositories'), - noneElement: page.querySelector('#none'), - repositories: repositories - }); - - return; - } - ApiClient.getJSON(ApiClient.getUrl('Repositories')).then(list => { repositories = list; populateList({ @@ -37,13 +26,15 @@ function reloadList(page) { }); } -function saveList() { +function saveList(page) { loading.show(); ApiClient.ajax({ type: 'POST', url: ApiClient.getUrl('Repositories'), data: JSON.stringify(repositories), contentType: 'application/json' + }).then(response => { + reloadList(page); }).catch(error => { console.error('error saving repositories'); loading.hide(); @@ -109,8 +100,7 @@ export default function(view, params) { return r.Url !== button.id; }); - saveList(); - reloadList(save); + saveList(save); }); }); @@ -130,11 +120,11 @@ export default function(view, params) { html += ''; html += '
'; html += '
'; - html += ``; + html += ``; html += `
${globalize.translate('LabelRepositoryNameHelp')}
`; html += '
'; html += '
'; - html += ``; + html += ``; html += `
${globalize.translate('LabelRepositoryUrlHelp')}
`; html += '
'; html += ``; @@ -153,8 +143,7 @@ export default function(view, params) { Enabled: true }); - saveList(); - reloadList(view); + saveList(view); dialogHelper.close(dialog); return false; }); diff --git a/src/elements/emby-input/emby-input.js b/src/elements/emby-input/emby-input.js index 03ba2b93aa..1cef349bf0 100644 --- a/src/elements/emby-input/emby-input.js +++ b/src/elements/emby-input/emby-input.js @@ -109,9 +109,7 @@ define(['layoutManager', 'browser', 'dom', 'css!./emby-input', 'registerElement' } EmbyInputPrototype.attachedCallback = function () { - this.labelElement.htmlFor = this.id; - onChange.call(this); };