| Server IP : 162.214.74.102 / Your IP : 216.73.216.192 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/www/lrsys_apps/team/assets/js/selectboxit/js/modules/ |
Upload File : |
// Disable Module
// ==============
// Disable
// -------
// Disables the new dropdown list
selectBoxIt.disable = function(callback) {
var self = this;
if(!self.options["disabled"]) {
// Makes sure the dropdown list is closed
self.close();
// Sets the `disabled` attribute on the original select box
self.selectBox.attr("disabled", "disabled");
// Makes the dropdown list not focusable by removing the `tabindex` attribute
self.dropdown.removeAttr("tabindex").
// Disables styling for enabled state
removeClass(self.theme["enabled"]).
// Enabled styling for disabled state
addClass(self.theme["disabled"]);
self.setOption("disabled", true);
// Triggers a `disable` custom event on the original select box
self.triggerEvent("disable");
}
// Provides callback function support
self._callbackSupport(callback);
// Maintains chainability
return self;
};
// Disable Option
// --------------
// Disables a single drop down option
selectBoxIt.disableOption = function(index, callback) {
var self = this, currentSelectBoxOption, hasNextEnabled, hasPreviousEnabled, type = $.type(index);
// If an index is passed to target an indropdownidual drop down option
if(type === "number") {
// Makes sure the dropdown list is closed
self.close();
// The select box option being targeted
currentSelectBoxOption = self.selectBox.find("option").eq(index);
// Triggers a `disable-option` custom event on the original select box and passes the disabled option
self.triggerEvent("disable-option");
// Disables the targeted select box option
currentSelectBoxOption.attr("disabled", "disabled");
// Disables the drop down option
self.listItems.eq(index).attr("data-disabled", "true").
// Applies disabled styling for the drop down option
addClass(self.theme["disabled"]);
// If the currently selected drop down option is the item being disabled
if(self.currentFocus === index) {
hasNextEnabled = self.listItems.eq(self.currentFocus).nextAll("li").not("[data-disabled='true']").first().length;
hasPreviousEnabled = self.listItems.eq(self.currentFocus).prevAll("li").not("[data-disabled='true']").first().length;
// If there is a currently enabled option beneath the currently selected option
if(hasNextEnabled) {
// Selects the option beneath the currently selected option
self.moveDown();
}
// If there is a currently enabled option above the currently selected option
else if(hasPreviousEnabled) {
// Selects the option above the currently selected option
self.moveUp();
}
// If there is not a currently enabled option
else {
// Disables the entire drop down list
self.disable();
}
}
}
// Provides callback function support
self._callbackSupport(callback);
// Maintains chainability
return self;
};
// _Is Disabled
// -----------
// Checks the original select box for the
// disabled attribute
selectBoxIt._isDisabled = function(callback) {
var self = this;
// If the original select box is disabled
if (self.originalElem.disabled) {
// Disables the dropdown list
self.disable();
}
// Maintains chainability
return self;
};