Skip to content

Commit 878305a

Browse files
committed
Releasing SelectBoxIt v3.8.0
1 parent 3225751 commit 878305a

22 files changed

Lines changed: 52 additions & 28 deletions

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = function(grunt) {
1616
},
1717
concat: {
1818
dist: {
19-
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'],
19+
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'],
2020
dest: 'src/javascripts/jquery.selectBoxIt.js'
2121
}
2222
},

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ If you find that you need a feature that SelectBoxIt does not currently support,
7070

7171
##Change Log
7272

73+
`3.8.0` - October 4, 2013
74+
75+
**Bug Fixes**
76+
- Fixed mobile hidden select box with bug: [#209](https://github.com/gfranko/jquery.selectBoxIt.js/issues/209)
77+
- Prevent disabled Selects from being clickable on iOS devices: [#203](https://github.com/gfranko/jquery.selectBoxIt.js/issues/203)
78+
- Fixed defaultText mobile bug: [#205](https://github.com/gfranko/jquery.selectBoxIt.js/issues/205)
79+
80+
**Improvements**
81+
- Improved performance by not removing option icons [#207](https://github.com/gfranko/jquery.selectBoxIt.js/issues/207)
82+
- Allow passing in a custom theme object [#204](https://github.com/gfranko/jquery.selectBoxIt.js/issues/204)
83+
7384
`3.7.0` - August 13, 2013
7485

7586
**Bug Fixes**

index.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@
357357
<option value="1">DM-Approved</option>
358358
<option value="2">DM-Denied</option>
359359
<option value="3">DM-Dealer Action Required</option>
360-
<option value="8">DM-Pending</option>
360+
<option value="8" data-search="fuck">DM-Pending</option>
361361
</select>
362362
</form>
363363

@@ -376,10 +376,7 @@
376376

377377
$('select').selectBoxIt({
378378
defaultText: 'Testing',
379-
autoWidth: false,
380-
theme: {
381-
'list': 'greg-list'
382-
}
379+
autoWidth: false
383380
});
384381

385382
$('form').removeClass('hidden');

src/javascripts/jquery.selectBoxIt.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,12 @@
492492

493493
currentDataText,
494494

495+
currentDataSearch,
496+
495497
currentText,
496498

499+
currentOption,
500+
497501
parent;
498502

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

518+
currentOption = $(this);
519+
514520
optgroupClass = "";
515521

516522
optgroupElement = "";
517523

518-
dataDisabled = $(this).prop("disabled");
524+
dataDisabled = currentOption.prop("disabled");
519525

520-
iconClass = $(this).attr("data-icon") || "";
526+
iconClass = currentOption.attr("data-icon") || "";
521527

522-
iconUrl = $(this).attr("data-iconurl") || "";
528+
iconUrl = currentOption.attr("data-iconurl") || "";
523529

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

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

528-
currentDataSelectedText = $(this).attr("data-selectedtext");
534+
currentDataSelectedText = currentOption.attr("data-selectedtext");
529535

530-
currentDataText = $(this).attr("data-text");
536+
currentDataText = currentOption.attr("data-text");
531537

532-
currentText = currentDataText ? currentDataText: $(this).text();
538+
currentText = currentDataText ? currentDataText: currentOption.text();
533539

534-
parent = $(this).parent();
540+
parent = currentOption.parent();
535541

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

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

540546
optgroupClass = "selectboxit-optgroup-option";
541547

542-
if($(this).index() === 0) {
548+
if(currentOption.index() === 0) {
543549

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

@@ -550,9 +556,11 @@
550556
// Uses string concatenation for speed (applies HTML attribute encoding)
551557
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>';
552558

559+
currentDataSearch = currentOption.attr("data-search");
560+
553561
// Stores all of the original select box options text inside of an array
554562
// (Used later in the `searchAlgorithm` method)
555-
self.textArray[index] = dataDisabled ? "": currentText;
563+
self.textArray[index] = dataDisabled ? "": currentDataSearch ? currentDataSearch: currentText;
556564

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

2770-
// Searches based on the first letter of the dropdown list options text if the currentText < 2 characters
2778+
// Searches based on the first letter of the dropdown list options text if the currentText < 3 characters
27712779
if (currentText.length < 3) {
27722780

27732781
alphaNumeric = new RegExp(currentText.charAt(0), "gi");

src/javascripts/jquery.selectBoxIt.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

src/javascripts/jquery.selectBoxIt.ariaAccessibility.js renamed to src/javascripts/modules/jquery.selectBoxIt.ariaAccessibility.js

File renamed without changes.

src/javascripts/jquery.selectBoxIt.copyAttributes.js renamed to src/javascripts/modules/jquery.selectBoxIt.copyAttributes.js

File renamed without changes.

src/javascripts/jquery.selectBoxIt.core.js renamed to src/javascripts/modules/jquery.selectBoxIt.core.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,12 @@
492492

493493
currentDataText,
494494

495+
currentDataSearch,
496+
495497
currentText,
496498

499+
currentOption,
500+
497501
parent;
498502

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

518+
currentOption = $(this);
519+
514520
optgroupClass = "";
515521

516522
optgroupElement = "";
517523

518-
dataDisabled = $(this).prop("disabled");
524+
dataDisabled = currentOption.prop("disabled");
519525

520-
iconClass = $(this).attr("data-icon") || "";
526+
iconClass = currentOption.attr("data-icon") || "";
521527

522-
iconUrl = $(this).attr("data-iconurl") || "";
528+
iconUrl = currentOption.attr("data-iconurl") || "";
523529

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

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

528-
currentDataSelectedText = $(this).attr("data-selectedtext");
534+
currentDataSelectedText = currentOption.attr("data-selectedtext");
529535

530-
currentDataText = $(this).attr("data-text");
536+
currentDataText = currentOption.attr("data-text");
531537

532-
currentText = currentDataText ? currentDataText: $(this).text();
538+
currentText = currentDataText ? currentDataText: currentOption.text();
533539

534-
parent = $(this).parent();
540+
parent = currentOption.parent();
535541

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

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

540546
optgroupClass = "selectboxit-optgroup-option";
541547

542-
if($(this).index() === 0) {
548+
if(currentOption.index() === 0) {
543549

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

@@ -550,9 +556,11 @@
550556
// Uses string concatenation for speed (applies HTML attribute encoding)
551557
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>';
552558

559+
currentDataSearch = currentOption.attr("data-search");
560+
553561
// Stores all of the original select box options text inside of an array
554562
// (Used later in the `searchAlgorithm` method)
555-
self.textArray[index] = dataDisabled ? "": currentText;
563+
self.textArray[index] = dataDisabled ? "": currentDataSearch ? currentDataSearch: currentText;
556564

557565
// Checks the original select box option for the `selected` attribute
558566
if (this.selected) {
File renamed without changes.

0 commit comments

Comments
 (0)