qtip2
Version:
Introducing... qTip2. The second generation of the advanced qTip plugin for the ever popular jQuery framework.
25 lines (18 loc) • 549 B
JavaScript
PROTOTYPE.disable = function(state) {
if(this.destroyed) { return this; }
// If 'toggle' is passed, toggle the current state
if(state === 'toggle') {
state = !(this.rendered ? this.tooltip.hasClass(CLASS_DISABLED) : this.disabled);
}
// Disable if no state passed
else if('boolean' !== typeof state) {
state = TRUE;
}
if(this.rendered) {
this.tooltip.toggleClass(CLASS_DISABLED, state)
.attr('aria-disabled', state);
}
this.disabled = !!state;
return this;
};
PROTOTYPE.enable = function() { return this.disable(FALSE); };