Introduce a helper function bindButton to do the button event binding with nice error logging.
This commit is contained in:
parent
1e59c5bbde
commit
6586aa6338
|
@ -813,6 +813,16 @@ function manageModalBtns(id) {
|
|||
});
|
||||
}
|
||||
|
||||
function bindButton(selector, action, data, func) {
|
||||
var elements = $j(selector);
|
||||
if ( !elements.length ) {
|
||||
console.log("Nothing found for " + selector);
|
||||
return;
|
||||
}
|
||||
elements.on(action, data, func);
|
||||
}
|
||||
|
||||
|
||||
function human_filesize(size, precision = 2) {
|
||||
var units = Array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||
var step = 1024;
|
||||
|
|
Loading…
Reference in New Issue