Skip to content

Commit 8739ff2

Browse files
committed
build a new version
1 parent ac1ff6c commit 8739ff2

File tree

10 files changed

+500
-510
lines changed

10 files changed

+500
-510
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nya-bootstrap-select",
3-
"version": "2.4.0",
3+
"version": "2.5.0",
44
"main": [
55
"dist/js/nya-bs-select.js",
66
"dist/css/nya-bs-select.css"

dist/css/nya-bs-select.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @lordfriend/nya-bootstrap-select v2.4.0
2+
* @lordfriend/nya-bootstrap-select v2.5.0
33
* Copyright 2014 Nyasoft
44
* Licensed under MIT license
55
*/

dist/css/nya-bs-select.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/nya-bs-select.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @lordfriend/nya-bootstrap-select v2.4.0
2+
* @lordfriend/nya-bootstrap-select v2.5.0
33
* Copyright 2014 Nyasoft
44
* Licensed under MIT license
55
*/
@@ -752,6 +752,28 @@ nyaBsSelect.directive('nyaBsSelect', ['$parse', '$document', '$timeout', '$compi
752752
};
753753
$document.on('click', outClick);
754754

755+
function reset_search() {
756+
searchBox.children().eq(0)[0].value = "";
757+
var options = dropdownMenu.children(),
758+
length = options.length,
759+
index,
760+
option,
761+
nyaBsOptionNode;
762+
for(index = 0; index < length; index++) {
763+
option = options.eq(index);
764+
if(option.hasClass('nya-bs-option')) {
765+
option.removeClass('not-match');
766+
}
767+
}
768+
noSearchResult.removeClass('show');
769+
nyaBsOptionNode = findFocus(true);
770+
771+
if(nyaBsOptionNode) {
772+
options.removeClass('active');
773+
jqLite(nyaBsOptionNode).addClass('active');
774+
}
775+
}
776+
755777

756778

757779
dropdownToggle.on('blur', function() {
@@ -766,6 +788,7 @@ nyaBsSelect.directive('nyaBsSelect', ['$parse', '$document', '$timeout', '$compi
766788
calcMenuSize();
767789
}
768790
if($attrs.liveSearch === 'true' && $element.hasClass('open')) {
791+
reset_search();
769792
searchBox.children().eq(0)[0].focus();
770793
nyaBsOptionNode = findFocus(true);
771794
if(nyaBsOptionNode) {

dist/js/nya-bs-select.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.

docs/dist/css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @lordfriend/nya-bootstrap-select v2.4.0
2+
* @lordfriend/nya-bootstrap-select v2.5.0
33
* Copyright 2014 Nyasoft
44
* Licensed under MIT license
55
*/

docs/dist/css/nya-bs-select.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @lordfriend/nya-bootstrap-select v2.4.0
2+
* @lordfriend/nya-bootstrap-select v2.5.0
33
* Copyright 2014 Nyasoft
44
* Licensed under MIT license
55
*/

docs/dist/js/nya-bs-select.js

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @lordfriend/nya-bootstrap-select v2.4.0
2+
* @lordfriend/nya-bootstrap-select v2.5.0
33
* Copyright 2014 Nyasoft
44
* Licensed under MIT license
55
*/
@@ -752,6 +752,28 @@ nyaBsSelect.directive('nyaBsSelect', ['$parse', '$document', '$timeout', '$compi
752752
};
753753
$document.on('click', outClick);
754754

755+
function reset_search() {
756+
searchBox.children().eq(0)[0].value = "";
757+
var options = dropdownMenu.children(),
758+
length = options.length,
759+
index,
760+
option,
761+
nyaBsOptionNode;
762+
for(index = 0; index < length; index++) {
763+
option = options.eq(index);
764+
if(option.hasClass('nya-bs-option')) {
765+
option.removeClass('not-match');
766+
}
767+
}
768+
noSearchResult.removeClass('show');
769+
nyaBsOptionNode = findFocus(true);
770+
771+
if(nyaBsOptionNode) {
772+
options.removeClass('active');
773+
jqLite(nyaBsOptionNode).addClass('active');
774+
}
775+
}
776+
755777

756778

757779
dropdownToggle.on('blur', function() {
@@ -766,6 +788,7 @@ nyaBsSelect.directive('nyaBsSelect', ['$parse', '$document', '$timeout', '$compi
766788
calcMenuSize();
767789
}
768790
if($attrs.liveSearch === 'true' && $element.hasClass('open')) {
791+
reset_search();
769792
searchBox.children().eq(0)[0].focus();
770793
nyaBsOptionNode = findFocus(true);
771794
if(nyaBsOptionNode) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lordfriend/nya-bootstrap-select",
3-
"version": "2.4.0",
3+
"version": "2.5.0",
44
"description": "An angular directive wraps bootstrap-select",
55
"main": "index.js",
66
"repository": {
@@ -31,7 +31,7 @@
3131
"highlight.js": "^8.4.0",
3232
"jquery": "^3.2.1",
3333
"jshint-stylish": "~0.1.5",
34-
"karma": "^0.12.31",
34+
"karma": "0.13.22",
3535
"karma-chrome-launcher": "^0.1.8",
3636
"karma-jasmine": "^0.1.5",
3737
"karma-ng-html2js-preprocessor": "^0.1.2",

0 commit comments

Comments
 (0)