Add some additional error handling and prevent disabled buttons from being triggered

This commit is contained in:
Duncan Sommerville 2015-11-11 19:26:51 -05:00
parent 8a5c25291e
commit 071de55329
4 changed files with 24 additions and 15 deletions

View file

@ -210,7 +210,10 @@ var AIRTIME = (function(AIRTIME) {
btn.element = buttonElement; //Save this guy in case you need it later.
//Bind event handlers to each button
$.each(btn.eventHandlers, function(eventName, eventCallback) {
$(buttonElement).on(eventName, eventCallback);
$(buttonElement).on(eventName, function () {
if ($(buttonElement).find("button").is(':disabled')) { return; }
eventCallback();
});
});
});