| 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 : |
// Mobile Module
// =============
// Set Mobile Text
// ---------------
// Updates the text of the drop down
selectBoxIt._updateMobileText = function() {
var self = this,
currentOption,
currentDataText,
currentText;
currentOption = self.selectBox.find("option").filter(":selected");
currentDataText = currentOption.attr("data-text");
currentText = currentDataText ? currentDataText: currentOption.text();
// Sets the new dropdown list text to the value of the original dropdown list
self._setText(self.dropdownText, currentText);
if(self.list.find('li[data-val="' + currentOption.val() + '"]').find("i").attr("class")) {
self.dropdownImage.attr("class", self.list.find('li[data-val="' + currentOption.val() + '"]').find("i").attr("class")).addClass("selectboxit-default-icon");
}
};
// Apply Native Select
// -------------------
// Applies the original select box directly over the new drop down
selectBoxIt._applyNativeSelect = function() {
// Stores the plugin context inside of the self variable
var self = this;
// Appends the native select box to the drop down (allows for relative positioning using the position() method)
self.dropdownContainer.append(self.selectBox);
self.dropdown.attr("tabindex", "-1");
// Positions the original select box directly over top the new dropdown list using position absolute and "hides" the original select box using an opacity of 0. This allows the mobile browser "wheel" interface for better usability.
self.selectBox.css({
"display": "block",
"visibility": "visible",
"width": self._realOuterWidth(self.dropdown),
"height": self.dropdown.outerHeight(),
"opacity": "0",
"position": "absolute",
"top": "0",
"left": "0",
"cursor": "pointer",
"z-index": "999999",
"margin": self.dropdown.css("margin"),
"padding": "0",
"-webkit-appearance": "menulist-button"
});
if(self.originalElem.disabled) {
self.triggerEvent("disable");
}
return this;
};
// Mobile Events
// -------------
// Listens to mobile-specific events
selectBoxIt._mobileEvents = function() {
var self = this;
self.selectBox.on({
"changed.selectBoxIt": function() {
self.hasChanged = true;
self._updateMobileText();
// Triggers the `option-click` event on mobile
self.triggerEvent("option-click");
},
"mousedown.selectBoxIt": function() {
// If the select box has not been changed, the defaultText option is being used
if(!self.hasChanged && self.options.defaultText && !self.originalElem.disabled) {
self._updateMobileText();
self.triggerEvent("option-click");
}
},
"enable.selectBoxIt": function() {
// Moves SelectBoxIt onto the page
self.selectBox.removeClass('selectboxit-rendering');
},
"disable.selectBoxIt": function() {
// Moves SelectBoxIt off the page
self.selectBox.addClass('selectboxit-rendering');
}
});
};
// Mobile
// ------
// Applies the native "wheel" interface when a mobile user is interacting with the dropdown
selectBoxIt._mobile = function(callback) {
// Stores the plugin context inside of the self variable
var self = this;
if(self.isMobile) {
self._applyNativeSelect();
self._mobileEvents();
}
// Maintains chainability
return this;
};