Skip to content

Commit

Permalink
Releasing SelectBoxIt v3.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gfranko committed Oct 4, 2013
1 parent 3225751 commit 878305a
Show file tree
Hide file tree
Showing 22 changed files with 52 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function(grunt) {
},
concat: {
dist: {
src: ['src/javascripts/jquery.selectBoxIt.core.js', 'src/javascripts/jquery.selectBoxIt.add.js', 'src/javascripts/jquery.selectBoxIt.ariaAccessibility.js', 'src/javascripts/jquery.selectBoxIt.copyAttributes.js', 'src/javascripts/jquery.selectBoxIt.destroy.js', 'src/javascripts/jquery.selectBoxIt.disable.js', 'src/javascripts/jquery.selectBoxIt.dynamicPositioning.js', 'src/javascripts/jquery.selectBoxIt.enable.js', 'src/javascripts/jquery.selectBoxIt.keyboardNavigation.js', 'src/javascripts/jquery.selectBoxIt.keyboardSearch.js', 'src/javascripts/jquery.selectBoxIt.mobile.js', 'src/javascripts/jquery.selectBoxIt.remove.js', 'src/javascripts/jquery.selectBoxIt.selectOption.js', 'src/javascripts/jquery.selectBoxIt.setOption.js', 'src/javascripts/jquery.selectBoxIt.setOptions.js', 'src/javascripts/jquery.selectBoxIt.wait.js', 'src/javascripts/jquery.selectBoxIt.endClosure.js'],
src: ['src/javascripts/modules/jquery.selectBoxIt.core.js', 'src/javascripts/modules/jquery.selectBoxIt.add.js', 'src/javascripts/modules/jquery.selectBoxIt.ariaAccessibility.js', 'src/javascripts/modules/jquery.selectBoxIt.copyAttributes.js', 'src/javascripts/modules/jquery.selectBoxIt.destroy.js', 'src/javascripts/modules/jquery.selectBoxIt.disable.js', 'src/javascripts/modules/jquery.selectBoxIt.dynamicPositioning.js', 'src/javascripts/modules/jquery.selectBoxIt.enable.js', 'src/javascripts/modules/jquery.selectBoxIt.keyboardNavigation.js', 'src/javascripts/modules/jquery.selectBoxIt.keyboardSearch.js', 'src/javascripts/modules/jquery.selectBoxIt.mobile.js', 'src/javascripts/modules/jquery.selectBoxIt.remove.js', 'src/javascripts/modules/jquery.selectBoxIt.selectOption.js', 'src/javascripts/modules/jquery.selectBoxIt.setOption.js', 'src/javascripts/modules/jquery.selectBoxIt.setOptions.js', 'src/javascripts/modules/jquery.selectBoxIt.wait.js', 'src/javascripts/modules/jquery.selectBoxIt.endClosure.js'],
dest: 'src/javascripts/jquery.selectBoxIt.js'
}
},
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ If you find that you need a feature that SelectBoxIt does not currently support,

##Change Log

`3.8.0` - October 4, 2013

**Bug Fixes**
- Fixed mobile hidden select box with bug: [#209](https://github.com/gfranko/jquery.selectBoxIt.js/issues/209)
- Prevent disabled Selects from being clickable on iOS devices: [#203](https://github.com/gfranko/jquery.selectBoxIt.js/issues/203)
- Fixed defaultText mobile bug: [#205](https://github.com/gfranko/jquery.selectBoxIt.js/issues/205)

**Improvements**
- Improved performance by not removing option icons [#207](https://github.com/gfranko/jquery.selectBoxIt.js/issues/207)
- Allow passing in a custom theme object [#204](https://github.com/gfranko/jquery.selectBoxIt.js/issues/204)

`3.7.0` - August 13, 2013

**Bug Fixes**
Expand Down
7 changes: 2 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
<option value="1">DM-Approved</option>
<option value="2">DM-Denied</option>
<option value="3">DM-Dealer Action Required</option>
<option value="8">DM-Pending</option>
<option value="8" data-search="fuck">DM-Pending</option>
</select>
</form>

Expand All @@ -376,10 +376,7 @@

$('select').selectBoxIt({
defaultText: 'Testing',
autoWidth: false,
theme: {
'list': 'greg-list'
}
autoWidth: false
});

$('form').removeClass('hidden');
Expand Down
28 changes: 18 additions & 10 deletions src/javascripts/jquery.selectBoxIt.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,12 @@

currentDataText,

currentDataSearch,

currentText,

currentOption,

parent;

// Checks the `showFirstOption` plugin option to determine if the first dropdown list option should be shown in the options list.
Expand All @@ -511,35 +515,37 @@
// into new list item elements of the new dropdown list
self.selectItems.each(function(index) {

currentOption = $(this);

optgroupClass = "";

optgroupElement = "";

dataDisabled = $(this).prop("disabled");
dataDisabled = currentOption.prop("disabled");

iconClass = $(this).attr("data-icon") || "";
iconClass = currentOption.attr("data-icon") || "";

iconUrl = $(this).attr("data-iconurl") || "";
iconUrl = currentOption.attr("data-iconurl") || "";

iconUrlClass = iconUrl ? "selectboxit-option-icon-url": "";

iconUrlStyle = iconUrl ? 'style="background-image:url(\'' + iconUrl + '\');"': "";

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

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

currentText = currentDataText ? currentDataText: $(this).text();
currentText = currentDataText ? currentDataText: currentOption.text();

parent = $(this).parent();
parent = currentOption.parent();

// If the current option being traversed is within an optgroup

if(parent.is("optgroup")) {

optgroupClass = "selectboxit-optgroup-option";

if($(this).index() === 0) {
if(currentOption.index() === 0) {

optgroupElement = '<span class="selectboxit-optgroup-header ' + parent.first().attr("class") + '"data-disabled="true">' + parent.first().attr("label") + '</span>';

Expand All @@ -550,9 +556,11 @@
// Uses string concatenation for speed (applies HTML attribute encoding)
currentItem += optgroupElement + '<li id="' + index + '" data-val="' + this.value + '" data-disabled="' + dataDisabled + '" class="' + optgroupClass + " selectboxit-option " + ($(this).attr("class") || "") + '"><a class="selectboxit-option-anchor"><span class="selectboxit-option-icon-container"><i class="selectboxit-option-icon ' + iconClass + ' ' + (iconUrlClass || self.theme["container"]) + '"' + iconUrlStyle + '></i></span>' + (self.options["html"] ? currentText: self.htmlEscape(currentText)) + '</a></li>';

currentDataSearch = currentOption.attr("data-search");

// Stores all of the original select box options text inside of an array
// (Used later in the `searchAlgorithm` method)
self.textArray[index] = dataDisabled ? "": currentText;
self.textArray[index] = dataDisabled ? "": currentDataSearch ? currentDataSearch: currentText;

// Checks the original select box option for the `selected` attribute
if (this.selected) {
Expand Down Expand Up @@ -2767,7 +2775,7 @@ selectBoxIt._destroySelectBoxIt = function() {
// Resets the regular expression with the new value of `self.currentText`
alphaNumeric = new RegExp(currentText, "gi");

// Searches based on the first letter of the dropdown list options text if the currentText < 2 characters
// Searches based on the first letter of the dropdown list options text if the currentText < 3 characters
if (currentText.length < 3) {

alphaNumeric = new RegExp(currentText.charAt(0), "gi");
Expand Down
4 changes: 2 additions & 2 deletions src/javascripts/jquery.selectBoxIt.min.js

Large diffs are not rendered by default.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,12 @@

currentDataText,

currentDataSearch,

currentText,

currentOption,

parent;

// Checks the `showFirstOption` plugin option to determine if the first dropdown list option should be shown in the options list.
Expand All @@ -511,35 +515,37 @@
// into new list item elements of the new dropdown list
self.selectItems.each(function(index) {

currentOption = $(this);

optgroupClass = "";

optgroupElement = "";

dataDisabled = $(this).prop("disabled");
dataDisabled = currentOption.prop("disabled");

iconClass = $(this).attr("data-icon") || "";
iconClass = currentOption.attr("data-icon") || "";

iconUrl = $(this).attr("data-iconurl") || "";
iconUrl = currentOption.attr("data-iconurl") || "";

iconUrlClass = iconUrl ? "selectboxit-option-icon-url": "";

iconUrlStyle = iconUrl ? 'style="background-image:url(\'' + iconUrl + '\');"': "";

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

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

currentText = currentDataText ? currentDataText: $(this).text();
currentText = currentDataText ? currentDataText: currentOption.text();

parent = $(this).parent();
parent = currentOption.parent();

// If the current option being traversed is within an optgroup

if(parent.is("optgroup")) {

optgroupClass = "selectboxit-optgroup-option";

if($(this).index() === 0) {
if(currentOption.index() === 0) {

optgroupElement = '<span class="selectboxit-optgroup-header ' + parent.first().attr("class") + '"data-disabled="true">' + parent.first().attr("label") + '</span>';

Expand All @@ -550,9 +556,11 @@
// Uses string concatenation for speed (applies HTML attribute encoding)
currentItem += optgroupElement + '<li id="' + index + '" data-val="' + this.value + '" data-disabled="' + dataDisabled + '" class="' + optgroupClass + " selectboxit-option " + ($(this).attr("class") || "") + '"><a class="selectboxit-option-anchor"><span class="selectboxit-option-icon-container"><i class="selectboxit-option-icon ' + iconClass + ' ' + (iconUrlClass || self.theme["container"]) + '"' + iconUrlStyle + '></i></span>' + (self.options["html"] ? currentText: self.htmlEscape(currentText)) + '</a></li>';

currentDataSearch = currentOption.attr("data-search");

// Stores all of the original select box options text inside of an array
// (Used later in the `searchAlgorithm` method)
self.textArray[index] = dataDisabled ? "": currentText;
self.textArray[index] = dataDisabled ? "": currentDataSearch ? currentDataSearch: currentText;

// Checks the original select box option for the `selected` attribute
if (this.selected) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
// Resets the regular expression with the new value of `self.currentText`
alphaNumeric = new RegExp(currentText, "gi");

// Searches based on the first letter of the dropdown list options text if the currentText < 2 characters
// Searches based on the first letter of the dropdown list options text if the currentText < 3 characters
if (currentText.length < 3) {

alphaNumeric = new RegExp(currentText.charAt(0), "gi");
Expand Down
File renamed without changes.

0 comments on commit 878305a

Please sign in to comment.