Skip to content

Commit

Permalink
Cleanup listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
viown authored and thornbill committed Jan 6, 2025
1 parent d061c00 commit 7952190
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/components/tvproviders/schedulesdirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export default function (page, providerId, options) {
}).then(function (result) {
page.querySelector('#selectListing').innerHTML = result.map(function (o) {
return '<option value="' + o.Id + '">' + o.Name + '</option>';
});
}).join('');

if (listingsId) {
page.querySelector('#selectListing').value = listingsId;
Expand Down Expand Up @@ -257,14 +257,14 @@ export default function (page, providerId, options) {
const hideSubmitButton = options.showSubmitButton === false;
page.querySelector('.btnSubmitListings').classList.toggle('hide', hideSubmitButton);

page.querySelector('.formLogin').addEventListener('submit', function () {
page.querySelector('.formLogin').addEventListener('submit', function (e) {
e.preventDefault();
submitLoginForm();
return false;
});

page.querySelector('.formListings').addEventListener('submit', function () {
page.querySelector('.formListings').addEventListener('submit', function (e) {
e.preventDefault();
submitListingsForm();
return false;
});

page.querySelector('.txtZipCode').addEventListener('change', function () {
Expand Down
8 changes: 4 additions & 4 deletions src/controllers/dashboard/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ function reloadVirtualFolders(page, virtualFolders) {
btnCardMenuElements.forEach(function (btn) {
btn.addEventListener('click', function () {
showCardMenu(page, btn, virtualFolders);
})
})
});
});
divVirtualFolders.querySelector('#addLibrary').addEventListener('click', function () {
addVirtualFolder(page);
});
Expand All @@ -201,8 +201,8 @@ function reloadVirtualFolders(page, virtualFolders) {
if (virtualFolder.ItemId) {
editVirtualFolder(page, virtualFolder);
}
})
})
});
});
loading.hide();
}

Expand Down
2 changes: 1 addition & 1 deletion src/controllers/dashboard/streaming.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function onSubmit() {
loading.show();
const form = this;
ApiClient.getServerConfiguration().then(function (config) {
config.RemoteClientBitrateLimit = parseInt(1e6 * parseFloat(form.querySelector('#txtRemoteClientBitrateLimit', form).value || '0'), 10);
config.RemoteClientBitrateLimit = parseInt(1e6 * parseFloat(form.querySelector('#txtRemoteClientBitrateLimit').value || '0'), 10);
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
});

Expand Down
8 changes: 4 additions & 4 deletions src/controllers/livetvstatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ function renderProviders(page, providers) {
btn.addEventListener('click', function () {
const id = this.getAttribute('data-id');
showProviderOptions(page, id, btn);
})
})
});
});
}
}

Expand Down Expand Up @@ -308,9 +308,9 @@ $(document).on('pageinit', '#liveTvStatusPage', function () {
});
if (page.querySelector('.formAddDevice')) {
// unused?
page.querySelector('.formAddDevice').addEventListener('submit', function () {
page.querySelector('.formAddDevice').addEventListener('submit', function (e) {
e.preventDefault();
submitAddDeviceForm(page);
return false;
});
}
page.querySelector('.btnAddProvider').addEventListener('click', function () {
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/wizard/start/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ function save(page) {
});
}

function onSubmit() {
function onSubmit(e) {
e.preventDefault();
save(dom.parentWithClass(this, 'page'));
return false;
}

export default function (view) {
Expand Down
3 changes: 1 addition & 2 deletions src/scripts/editorsidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'material-design-icons-iconfont';
import globalize from 'lib/globalize';
import Dashboard from 'utils/dashboard';
import { getParameterByName } from 'utils/url';
import dom from './dom';

// Disable the naming rules since jstree requires snake_case variables
/* eslint-disable @typescript-eslint/naming-convention */
Expand Down Expand Up @@ -218,7 +217,7 @@ function onNodeSelect(event, data) {
}

function onNodeOpen(_, data) {
const page = dom.parentWithClass(this, 'page');
const page = $(this).parents('.page')[0];
const node = data.node;
if (node.children) {
loadNodesToLoad(page, node);
Expand Down

0 comments on commit 7952190

Please sign in to comment.