Skip to content

Commit

Permalink
compile js
Browse files Browse the repository at this point in the history
  • Loading branch information
webaware committed Nov 22, 2023
1 parent 275340a commit 03d8816
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions static/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,24 @@
mustUse('deactivate');
}
});

/**
* add an event handler to element, if element is found
* @param {String} selector
* @param {String} event
* @param {Function} handler
*/

function addHandler(selector, event, handler) {
var element = document.getElementById(selector);

const element = document.getElementById(selector);
if (element) {
element.addEventListener(event, handler, false);
}
}

/**
* reload page with request to enable / disable the must-use plugin
* @param {String} action
*/


function mustUse(action) {
document.location = settings.mu_url + "&action=" + action;
}
Expand Down

0 comments on commit 03d8816

Please sign in to comment.