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

Fix multiplication of event listeners

This commit is contained in:
Dmitry Lyzo 2020-12-10 11:27:51 +03:00
parent 3992265189
commit 6a6eae96e6
2 changed files with 96 additions and 100 deletions

View file

@ -56,8 +56,7 @@ function showSaveMessage(recordingPathChanged) {
} }
} }
export default function () { $(document).on('pageinit', '#liveTvSettingsPage', function () {
$(document).on('pageinit', '#liveTvSettingsPage', function () {
const page = this; const page = this;
$('.liveTvSettingsForm').off('submit', onSubmit).on('submit', onSubmit); $('.liveTvSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
$('#btnSelectRecordingPath', page).on('click.selectDirectory', function () { $('#btnSelectRecordingPath', page).on('click.selectDirectory', function () {
@ -120,11 +119,10 @@ export default function () {
}); });
}); });
}); });
}).on('pageshow', '#liveTvSettingsPage', function () { }).on('pageshow', '#liveTvSettingsPage', function () {
loading.show(); loading.show();
const page = this; const page = this;
ApiClient.getNamedConfiguration('livetv').then(function (config) { ApiClient.getNamedConfiguration('livetv').then(function (config) {
loadPage(page, config); loadPage(page, config);
}); });
}); });
}

View file

@ -293,8 +293,7 @@ function onDevicesListClick(e) {
} }
} }
export default function () { $(document).on('pageinit', '#liveTvStatusPage', function () {
$(document).on('pageinit', '#liveTvStatusPage', function () {
const page = this; const page = this;
$('.btnAddDevice', page).on('click', function () { $('.btnAddDevice', page).on('click', function () {
addDevice(this); addDevice(this);
@ -307,7 +306,7 @@ export default function () {
addProvider(this); addProvider(this);
}); });
page.querySelector('.devicesList').addEventListener('click', onDevicesListClick); page.querySelector('.devicesList').addEventListener('click', onDevicesListClick);
}).on('pageshow', '#liveTvStatusPage', function () { }).on('pageshow', '#liveTvStatusPage', function () {
const page = this; const page = this;
reload(page); reload(page);
taskButton({ taskButton({
@ -316,7 +315,7 @@ export default function () {
taskKey: 'RefreshGuide', taskKey: 'RefreshGuide',
button: page.querySelector('.btnRefresh') button: page.querySelector('.btnRefresh')
}); });
}).on('pagehide', '#liveTvStatusPage', function () { }).on('pagehide', '#liveTvStatusPage', function () {
const page = this; const page = this;
taskButton({ taskButton({
mode: 'off', mode: 'off',
@ -324,5 +323,4 @@ export default function () {
taskKey: 'RefreshGuide', taskKey: 'RefreshGuide',
button: page.querySelector('.btnRefresh') button: page.querySelector('.btnRefresh')
}); });
}); });
}