| 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/school/assets/js/selectboxit/js/modules/ |
Upload File : |
// Enable Module
// =============
// Enable
// ------
// Enables the new dropdown list
selectBoxIt.enable = function(callback) {
var self = this;
if(self.options["disabled"]) {
// Triggers a `enable` custom event on the original select box
self.triggerEvent("enable");
// Removes the `disabled` attribute from the original dropdown list
self.selectBox.removeAttr("disabled");
// Make the dropdown list focusable
self.dropdown.attr("tabindex", 0).
// Disable styling for disabled state
removeClass(self.theme["disabled"]).
// Enables styling for enabled state
addClass(self.theme["enabled"]);
self.setOption("disabled", false);
// Provide callback function support
self._callbackSupport(callback);
}
// Maintains chainability
return self;
};
// Enable Option
// -------------
// Disables a single drop down option
selectBoxIt.enableOption = function(index, callback) {
var self = this, currentSelectBoxOption, currentIndex = 0, hasNextEnabled, hasPreviousEnabled, type = $.type(index);
// If an index is passed to target an indropdownidual drop down option
if(type === "number") {
// The select box option being targeted
currentSelectBoxOption = self.selectBox.find("option").eq(index);
// Triggers a `enable-option` custom event on the original select box and passes the enabled option
self.triggerEvent("enable-option");
// Disables the targeted select box option
currentSelectBoxOption.removeAttr("disabled");
// Disables the drop down option
self.listItems.eq(index).attr("data-disabled", "false").
// Applies disabled styling for the drop down option
removeClass(self.theme["disabled"]);
}
// Provides callback function support
self._callbackSupport(callback);
// Maintains chainability
return self;
};