Rename airtime_mvc/ to legacy/
This commit is contained in:
parent
f0879322c2
commit
3e18d42c8b
1316 changed files with 0 additions and 0 deletions
50
legacy/public/js/airtime/buttons/buttons.js
Normal file
50
legacy/public/js/airtime/buttons/buttons.js
Normal file
|
@ -0,0 +1,50 @@
|
|||
var AIRTIME = (function(AIRTIME) {
|
||||
var mod, DEFAULT_CLASS = 'ui-button ui-state-default', DISABLED_CLASS = 'ui-state-disabled';
|
||||
|
||||
if (AIRTIME.button === undefined) {
|
||||
AIRTIME.button = {};
|
||||
}
|
||||
mod = AIRTIME.button;
|
||||
|
||||
mod.isDisabled = function(c, useParent) {
|
||||
var button = $("." + c);
|
||||
if (useParent) {
|
||||
button = button.parent();
|
||||
}
|
||||
|
||||
if (button.hasClass(DISABLED_CLASS)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
mod.enableButton = function(c, useParent) {
|
||||
if (useParent) {
|
||||
var button = $("." + c).parent();
|
||||
} else {
|
||||
var button = $("." + c);
|
||||
}
|
||||
|
||||
if (button.hasClass(DISABLED_CLASS)) {
|
||||
button.removeClass(DISABLED_CLASS);
|
||||
button.removeAttr('disabled');
|
||||
}
|
||||
};
|
||||
|
||||
mod.disableButton = function(c, useParent) {
|
||||
if (useParent) {
|
||||
var button = $("." + c).parent();
|
||||
} else {
|
||||
var button = $("." + c);
|
||||
}
|
||||
|
||||
if (!button.hasClass(DISABLED_CLASS)) {
|
||||
button.addClass(DISABLED_CLASS);
|
||||
button.attr('disabled', 'disabled');
|
||||
}
|
||||
};
|
||||
|
||||
return AIRTIME;
|
||||
|
||||
}(AIRTIME || {}));
|
Loading…
Add table
Add a link
Reference in a new issue