mirror of
https://github.com/SuperBFG7/ympd
synced 2025-02-04 21:29:20 +00:00
Fix: optimize code
This commit is contained in:
parent
83cb02c370
commit
0aa60f820f
@ -565,42 +565,15 @@ function appInit() {
|
|||||||
appGoto(app.current.app, app.current.tab, app.current.view, app.current.page + '/' + event.target.getAttribute('data-tag') + '/' + app.current.search);
|
appGoto(app.current.app, app.current.tab, app.current.view, app.current.page + '/' + event.target.getAttribute('data-tag') + '/' + app.current.search);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
document.getElementById('QueueColsDropdown').addEventListener('click', function(event) {
|
var dropdowns = ['QueueColsDropdown', 'BrowseFilesystemColsDropdown', 'SearchColsDropdown', 'BrowsePlaylistsDetailColsDropdown',
|
||||||
if (event.target.nodeName == 'INPUT') {
|
'BrowseDatabaseColsDropdown', 'PlaybackColsDropdown'];
|
||||||
event.stopPropagation();
|
for (var i = 0; i < dropdowns.length; i++) {
|
||||||
}
|
document.getElementById(dropdowns[i]).addEventListener('click', function(event) {
|
||||||
}, false);
|
if (event.target.nodeName == 'INPUT')
|
||||||
|
event.stopPropagation();
|
||||||
|
}, false);
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById('BrowseFilesystemColsDropdown').addEventListener('click', function(event) {
|
|
||||||
if (event.target.nodeName == 'INPUT') {
|
|
||||||
event.stopPropagation();
|
|
||||||
}
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
document.getElementById('SearchColsDropdown').addEventListener('click', function(event) {
|
|
||||||
if (event.target.nodeName == 'INPUT') {
|
|
||||||
event.stopPropagation();
|
|
||||||
}
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
document.getElementById('BrowsePlaylistsDetailColsDropdown').addEventListener('click', function(event) {
|
|
||||||
if (event.target.nodeName == 'INPUT') {
|
|
||||||
event.stopPropagation();
|
|
||||||
}
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
document.getElementById('BrowseDatabaseColsDropdown').addEventListener('click', function(event) {
|
|
||||||
if (event.target.nodeName == 'INPUT') {
|
|
||||||
event.stopPropagation();
|
|
||||||
}
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
document.getElementById('PlaybackColsDropdown').addEventListener('click', function(event) {
|
|
||||||
if (event.target.nodeName == 'INPUT') {
|
|
||||||
event.stopPropagation();
|
|
||||||
}
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
document.getElementById('search').addEventListener('submit', function() {
|
document.getElementById('search').addEventListener('submit', function() {
|
||||||
return false;
|
return false;
|
||||||
}, false);
|
}, false);
|
||||||
@ -699,7 +672,6 @@ function appInit() {
|
|||||||
|
|
||||||
function parseCmd(event, href) {
|
function parseCmd(event, href) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
|
||||||
var cmd = href;
|
var cmd = href;
|
||||||
if (typeof(href) == 'string')
|
if (typeof(href) == 'string')
|
||||||
cmd = JSON.parse(href);
|
cmd = JSON.parse(href);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user