src/javascripts/modules/jquery.selectBoxIt.core.js
function(event, internal) {

                    var currentOption,
                        currentDataSelectedText;

                    // If the user called the change method
                    if(!internal) {

                        currentOption = self.list.find('li[data-val="' + self.originalElem.value + '"]');

                        // If there is a dropdown option with the same value as the original select box element
                        if(currentOption.length) {

                            self.listItems.eq(self.currentFocus).removeClass(self.focusClass);

                            self.currentFocus = +currentOption.attr("data-id");

                        }

                    }

                    currentOption = self.listItems.eq(self.currentFocus);

                    currentDataSelectedText = currentOption.attr("data-selectedtext");

                    currentDataText = currentOption.attr("data-text");

                    currentText = currentDataText ?  currentDataText: currentOption.find("a").text();

                    // Sets the new dropdown list text to the value of the current option
                    self._setText(self.dropdownText, currentDataSelectedText || currentText);

                    self.dropdownText.attr("data-val", self.originalElem.value);

                    if(currentOption.find("i").attr("class")) {

                        self.dropdownImage.attr("class", currentOption.find("i").attr("class")).addClass("selectboxit-default-icon");

                        self.dropdownImage.attr("style", currentOption.find("i").attr("style"));
                    }

                    // Triggers a custom changed event on the original select box
                    self.triggerEvent("changed");

                }
function(event, internal) {

                    var currentOption,
                        currentDataSelectedText;

                    // If the user called the change method
                    if(!internal) {

                        currentOption = self.list.find('li[data-val="' + self.originalElem.value + '"]');

                        // If there is a dropdown option with the same value as the original select box element
                        if(currentOption.length) {

                            self.listItems.eq(self.currentFocus).removeClass(self.focusClass);

                            self.currentFocus = +currentOption.attr("data-id");

                        }

                    }

                    currentOption = self.listItems.eq(self.currentFocus);

                    currentDataSelectedText = currentOption.attr("data-selectedtext");

                    currentDataText = currentOption.attr("data-text");

                    currentText = currentDataText ?  currentDataText: currentOption.find("a").text();

                    // Sets the new dropdown list text to the value of the current option
                    self._setText(self.dropdownText, currentDataSelectedText || currentText);

                    self.dropdownText.attr("data-val", self.originalElem.value);

                    if(currentOption.find("i").attr("class")) {

                        self.dropdownImage.attr("class", currentOption.find("i").attr("class")).addClass("selectboxit-default-icon");

                        self.dropdownImage.attr("style", currentOption.find("i").attr("style"));
                    }

                    // Triggers a custom changed event on the original select box
                    self.triggerEvent("changed");

                }
function ( event , internal ) { var currentOption , currentDataSelectedText ; // If the user called the change method if ( ! internal ) { currentOption = self . list . find ( 'li[data-val="' + self . originalElem . value + '"]' ) ; // If there is a dropdown option with the same value as the original select box element if ( currentOption . length ) { self . listItems . eq ( self . currentFocus ) . removeClass ( self . focusClass ) ; self . currentFocus = + currentOption . attr ( "data-id" ) ; } } currentOption = self . listItems . eq ( self . currentFocus ) ; currentDataSelectedText = currentOption . attr ( "data-selectedtext" ) ; currentDataText = currentOption . attr ( "data-text" ) ; currentText = currentDataText ? currentDataText : currentOption . find ( "a" ) . text ( ) ; // Sets the new dropdown list text to the value of the current option self . _setText ( self . dropdownText , currentDataSelectedText || currentText ) ; self . dropdownText . attr ( "data-val" , self . originalElem . value ) ; if ( currentOption . find ( "i" ) . attr ( "class" ) ) { self . dropdownImage . attr ( "class" , currentOption . find ( "i" ) . attr ( "class" ) ) . addClass ( "selectboxit-default-icon" ) ; self . dropdownImage . attr ( "style" , currentOption . find ( "i" ) . attr ( "style" ) ) ; } // Triggers a custom changed event on the original select box self . triggerEvent ( "changed" ) ; }
`change` event handler with the `selectBoxIt` namespace
change event handler with the selectBoxIt namespace