diff --git a/bower.json b/bower.json
index 1685537..e86e4cf 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
{
"name": "nya-bootstrap-select",
- "version": "2.1.8",
+ "version": "2.1.9",
"main": [
"dist/js/nya-bs-select.js",
"dist/css/nya-bs-select.css"
diff --git a/dist/css/nya-bs-select.css b/dist/css/nya-bs-select.css
index 9d1184f..953c263 100644
--- a/dist/css/nya-bs-select.css
+++ b/dist/css/nya-bs-select.css
@@ -1,5 +1,5 @@
/**
- * @lordfriend/nya-bootstrap-select v2.1.8
+ * @lordfriend/nya-bootstrap-select v2.1.9
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
diff --git a/dist/css/nya-bs-select.min.css b/dist/css/nya-bs-select.min.css
index d9f5b88..e576047 100644
--- a/dist/css/nya-bs-select.min.css
+++ b/dist/css/nya-bs-select.min.css
@@ -1,5 +1,5 @@
/**
- * @lordfriend/nya-bootstrap-select v2.1.8
+ * @lordfriend/nya-bootstrap-select v2.1.9
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
diff --git a/dist/js/nya-bs-select.js b/dist/js/nya-bs-select.js
index e8506fc..c4313d7 100644
--- a/dist/js/nya-bs-select.js
+++ b/dist/js/nya-bs-select.js
@@ -1,5 +1,5 @@
/**
- * @lordfriend/nya-bootstrap-select v2.1.8
+ * @lordfriend/nya-bootstrap-select v2.1.9
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
@@ -431,8 +431,8 @@ nyaBsSelect.directive('nyaBsSelect', ['$parse', '$document', '$timeout', '$compi
var ACTIONS_BOX = '
' +
'
' +
- '' +
- '' +
+ '' +
+ '' +
'
' +
'
';
diff --git a/dist/js/nya-bs-select.min.js b/dist/js/nya-bs-select.min.js
index 0041653..040bd06 100644
--- a/dist/js/nya-bs-select.min.js
+++ b/dist/js/nya-bs-select.min.js
@@ -1,6 +1,6 @@
/**
- * @lordfriend/nya-bootstrap-select v2.1.8
+ * @lordfriend/nya-bootstrap-select v2.1.9
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
-!function(){"use strict";function a(){return++j}function b(a){return a&&a.window===a}function c(a){return"string"==typeof a}function d(a){if(null==a||b(a))return!1;var d=a.length;return 1===a.nodeType&&d?!0:c(a)||Array.isArray(a)||0===d||"number"==typeof d&&d>0&&d-1 in a}function e(){return Object.create(null)}function f(b,c){var d,e=typeof b;return"function"==e||"object"==e&&null!==b?"function"==typeof(d=b.$$hashKey)?d=b.$$hashKey():void 0===d&&(d=b.$$hashKey=(c||a)()):d=b,e+":"+d}function g(a,b,c){var d,e,f=[],g=[];for(d=0;dc;c++)if(v(b,a[c]))return!0;return!1},p=function(a,b){var c,d=a.length;if(0===d)return-1;for(c=0;d>c;c++)if(v(b,a[c]))return c;return-1},q=function(a,b,c){var d,e=a,f=typeof c;if(a==b)return null;do if("string"===f){if(d=" "+e.className+" ",1===e.nodeType&&d.replace(/[\t\r\n\f]/g," ").indexOf(c)>=0)return e}else if(e==c)return e;while((e=e.parentNode)&&e!=b&&9!==e.nodeType);return null},r=function(a){var b,c=a.className.replace(/[\t\r\n\f]/g," ").trim();b=c.split(" ");for(var d=0;dd;d++)if(-1!==c.eq(d).text().toLowerCase().indexOf(b.toLowerCase()))return!0;return!1},u=angular.element,v=angular.equals,w=angular.copy,x=angular.extend,y=angular.module("nya.bootstrap.select",[]);y.provider("nyaBsConfig",function(){var a=null,b={"en-us":{defaultNoneSelection:"Nothing selected",noSearchResult:"NO SEARCH RESULT",numberItemSelected:"%d items selected",selectAll:"Select All",deselectAll:"Deselect All"}},c=w(b);this.setLocalizedText=function(a,b){if(!a)throw new Error("localeId must be a string formatted as languageId-countryId");c[a]||(c[a]={}),c[a]=x(c[a],b)},this.useLocale=function(b){a=b},this.$get=["$locale",function(d){var e;return e=a?c[a]:c[d.id],e||(e=b["en-us"]),e}]}),y.controller("nyaBsSelectCtrl",function(){var a=this;a.keyIdentifier=null,a.valueIdentifier=null,a.isMultiple=!1,a.onCollectionChange=function(){},a.setId=function(b){a.id=b||"id#"+Math.floor(1e4*Math.random())}}),y.directive("nyaBsSelect",["$parse","$document","$timeout","$compile","nyaBsConfig",function(a,b,c,d,e){var f="Nothing selected",g='',h='',j='',k='',l='NO SEARCH RESULT',m='';return{restrict:"ECA",require:["ngModel","nyaBsSelect"],controller:"nyaBsSelectCtrl",compile:function(n,x){n.addClass("btn-group");var y,z,A,B,C,D,E,F,G=function(a){var b;return b=x.titleTpl?u(x.titleTpl):x.title?document.createTextNode(x.title):L.defaultNoneSelectionTpl?u(L.defaultNoneSelectionTpl):L.defaultNoneSelection?document.createTextNode(L.defaultNoneSelection):document.createTextNode(f),a&&(x.titleTpl||L.defaultNoneSelectionTpl)?d(b)(a):b},H=n.children(),I=u(g),J=u(h),K=u(k),L=e,M="undefined"!=typeof x.multiple;for(B=r(n[0]),B.forEach(function(a){/btn-(?:primary|info|success|warning|danger|inverse)/.test(a)&&(n.removeClass(a),I.removeClass("btn-default"),I.addClass(a)),/btn-(?:lg|sm|xs)/.test(a)&&(n.removeClass(a),I.addClass(a))}),K.append(H),C=H.length,D=0;C>D;D++)E=H.eq(D),(E.hasClass("nya-bs-option")||E.attr("nya-bs-option"))&&(E.find("a").attr("tabindex","0"),F=E.attr("value"),angular.isString(F)&&""!==F&&(E.attr("data-value",F),E.removeAttr("value")));return"true"===x.liveSearch&&(y=u(j),x.noSearchTitle?l=l.replace("NO SEARCH RESULT",x.noSearchTitle):x.noSearchTitleTpl?l=l.replace("NO SEARCH RESULT",x.noSearchTitleTpl):L.noSearchResultTpl?l=l.replace("NO SEARCH RESULT",L.noSearchResultTpl):L.noSearchResult&&(l=l.replace("NO SEARCH RESULT",L.noSearchResult)),z=u(l),J.append(y),K.append(z)),"true"===x.actionsBox&&M&&(L.selectAllTpl?m=m.replace("SELECT ALL",L.selectAllTpl):L.selectAll&&(m=m.replace("SELECT ALL",L.selectAll)),L.deselectAllTpl?m=m.replace("DESELECT ALL",L.deselectAllTpl):L.selectAll&&(m=m.replace("DESELECT ALL",L.deselectAll)),A=u(m),J.append(A)),u(I[0].querySelector(".special-title")).append(G()),J.append(K),n.append(I),n.append(J),function(e,f,g,h){function j(){var a,b,c=M.children(),d=c.length;for(a=0;d>a;a++)if(b=c.eq(a),b.hasClass("active")&&b.hasClass("nya-bs-option")&&!b.hasClass("not-match"))return b;return null}function k(a){for(var b,c=a.childNodes,d=c.length,e=0;d>e;e++)if(b=c[e],1===b.nodeType&&"a"===b.tagName.toLowerCase()){b.focus();break}}function l(a){var b;b=a?M.children().eq(0):M.children().eq(M.children().length-1);for(var c=0;c0){c=E.$viewValue,d=Array.isArray(c)?w(c):[];for(var f=0;f\s*(\d+)\s*/))&&(j=parseInt(i[1],10)),"undefined"!=typeof j&&a.length>j)return b.empty(),void(L.numberItemSelectedTpl?b.append(u(L.numberItemSelectedTpl.replace("%d",a.length))):L.numberItemSelected?b.append(document.createTextNode(L.numberItemSelected.replace("%d",a.length))):b.append(document.createTextNode(a.length+" items selected")));for(f=0;m>f;f++)e=l.eq(f),e.hasClass("nya-bs-option")&&(c=x(e),I?Array.isArray(a)&&o(a,c)&&(h=e.attr("title"),h?n.push(document.createTextNode(h)):(n.push(y(e)),p.push(e.data("isolateScope")))):v(a,c)&&(h=e.attr("title"),h?n.push(document.createTextNode(h)):(n.push(y(e)),p.push(e.data("isolateScope")))));if(0===n.length)b.empty(),J.addClass("show-special-title");else if(1===n.length)J.removeClass("show-special-title"),b.empty(),k=p[0]?d(n[0])(p[0]):n[0],b.append(k);else for(J.removeClass("show-special-title"),b.empty(),f=0;fb;b++)if(a=c.eq(b),a.hasClass("nya-bs-option")||a.attr("nya-bs-option")){B=a[0].clientHeight;break}if(/\d+/.test(g.size)){var e=parseInt(g.size,10);M.css("max-height",e*B+"px"),M.css("overflow-y","auto")}}var B,C,D,E=h[0],F=h[1],G=!1,H=a(F.valueExp),I="undefined"!=typeof g.multiple,J=u(f[0].querySelector(".dropdown-toggle")),K=J.next(),M=u(K[0].querySelector(".dropdown-menu.inner")),N=u(K[0].querySelector(".bs-searchbox")),O=u(M[0].querySelector(".no-search-result")),P=u(K[0].querySelector(".bs-actionsbox"));F.valueExp&&(D=function(a,b){return H(a,b)}),F.setId(f.attr("id")),I&&(F.isMultiple=!0,E.$isEmpty=function(a){return!a||0===a.length}),"undefined"!=typeof g.disabled&&e.$watch(g.disabled,function(a){a?(J.addClass("disabled"),J.attr("disabled","disabled"),C=J.attr("tabindex"),J.attr("tabindex","-1"),G=!0):(J.removeClass("disabled"),J.removeAttr("disabled"),C?J.attr("tabindex",C):J.removeAttr("tabindex"),G=!1)}),F.onCollectionChange=function(a,b){var c,d=[],f=!1,g=w(E.$modelValue);if(g){if(Array.isArray(a)&&a.length>0){if(D)for(c=0;ca;a++)b=f.eq(a),b.hasClass("nya-bs-option")&&(t(b.find("a"),d)?(b.removeClass("not-match"),e++):b.addClass("not-match"));0===e?O.addClass("show"):O.removeClass("show")}else{for(a=0;g>a;a++)b=f.eq(a),b.hasClass("nya-bs-option")&&b.removeClass("not-match");O.removeClass("show")}c=l(!0),c&&(f.removeClass("active"),u(c).addClass("active"))}),E.$render=function(){var a,b,c=E.$modelValue,d=M.children(),e=d.length;if("undefined"==typeof c)for(a=0;e>a;a++)d.eq(a).hasClass("nya-bs-option")&&d.eq(a).removeClass("selected");else for(a=0;e>a;a++)d.eq(a).hasClass("nya-bs-option")&&(b=x(d.eq(a)),I?o(c,b)?d.eq(a).addClass("selected"):d.eq(a).removeClass("selected"):v(c,b)?d.eq(a).addClass("selected"):d.eq(a).removeClass("selected"));z()},f.on("keydown",function(a){var b=a.keyCode;if(27===b||13===b||38===b||40===b){if(a.preventDefault(),G)return void a.stopPropagation();var c,d,e,h,i=q(a.target,f[0],J[0]);"true"===g.liveSearch?d=q(a.target,f[0],N[0]):c=q(a.target,f[0],K[0]),i?13!==b&&38!==b&&40!==b||f.hasClass("open")||(a.stopPropagation(),f.addClass("open"),"undefined"==typeof B&&A(),"true"===g.liveSearch?(N.children().eq(0)[0].focus(),h=l(!0),h&&(M.children().removeClass("active"),u(h).addClass("active"))):(h=l(!0),h&&k(h))):c?27===b?(J[0].focus(),f.hasClass("open")&&f.triggerHandler("blur"),f.removeClass("open"),a.stopPropagation()):38===b?(a.stopPropagation(),h=m(a.target.parentNode,"previousSibling"),h?k(h):(h=l(!1),h&&k(h))):40===b?(a.stopPropagation(),h=m(a.target.parentNode,"nextSibling"),h?k(h):(h=l(!0),h&&k(h))):13===b&&(a.stopPropagation(),e=u(a.target.parentNode),e.hasClass("nya-bs-option")&&(r(e),I||J[0].focus())):d&&(27===b?(J[0].focus(),f.removeClass("open"),a.stopPropagation()):38===b?(a.stopPropagation(),e=j(),e&&(h=m(e[0],"previousSibling"),h?(e.removeClass("active"),u(h).addClass("active")):(h=l(!1),h&&(e.removeClass("active"),u(h).addClass("active"))))):40===b?(a.stopPropagation(),e=j(),e&&(h=m(e[0],"nextSibling"),h?(e.removeClass("active"),u(h).addClass("active")):(h=l(!0),h&&(e.removeClass("active"),u(h).addClass("active"))))):13===b&&(e=j(),e&&(r(e),I||J[0].focus())))}}),e.$on("$destroy",function(){M.off(),J.off(),N.off&&N.off(),b.off("click",Q)})}}}}]),y.directive("nyaBsOption",["$parse",function(a){var b=/^\s*(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/;return{restrict:"A",transclude:"element",priority:1e3,terminal:!0,require:["^nyaBsSelect","^ngModel"],compile:function(c,i){var j=i.nyaBsOption,p=document.createComment(" end nyaBsOption: "+j+" "),q=j.match(b);if(!q)throw new Error("invalid expression");var r,s,t,w,x,y=i.value,z=y?a(y):null,A=q[3]||q[1],B=q[2],C=q[4],D=q[5]?a(q[5]):null,E=q[6],F={$id:f},G={};return E?w=a(E):(r=function(a,b){return f(b)},s=function(a){return a}),function(a,b,c,f,i){function j(a){var c,f,j,w,y,z,C,D,F,G,J,L,M,N,O,P=b[0],Q=e(),R=[];if(x&&(L=[]),d(a))z=a,y=t||r;else{y=t||s,z=[];for(var S in a)a.hasOwnProperty(S)&&"$"!=S.charAt(0)&&z.push(S);z.sort()}for(C=z.length,D=new Array(C),c=0;C>c;c++)if(f=a===z?c:z[c],j=a[f],w=y(f,j,c),O={},B&&(O[B]=f),O[A]=j,R.push(O),x&&(G=x(f,j),-1===L.indexOf(G)&&G&&L.push(G)),K[w])F=K[w],delete K[w],x&&(F.group=G),F.key=f,F.value=j,Q[w]=F,D[c]=F;else{if(Q[w])throw D.forEach(function(a){a&&a.scope&&(K[a.id]=a)}),new Error("Duplicates in a select are not allowed. Use 'track by' expression to specify unique keys.");D[c]={id:w,scope:void 0,clone:void 0,key:f,value:j},Q[w]=!0,G&&(D[c].group=G)}L&&L.length>0&&(D=g(D,L,"group"));for(var T in K)F=K[T],N=h(F.clone),N.removeData("isolateScope"),N.remove(),F.scope.$destroy();for(c=0;C>c;c++)F=D[c],F.scope?(J=P,k(F)!=J&&u(P).after(F.clone),P=l(F),m(F.scope,c,A,F.value,B,F.key,C,F.group)):i(function(a,b){n(a,b),F.scope=b;var d=p.cloneNode(!1);a[a.length++]=d,u(P).after(a),a.addClass("nya-bs-option"),j=q?q(F.key,F.value):F.value||F.key,H.isMultiple?Array.isArray(I.$modelValue)&&o(I.$modelValue,j)&&a.addClass("selected"):v(j,I.$modelValue)&&a.addClass("selected"),P=d,F.clone=a,Q[F.id]=F,m(F.scope,c,A,F.value,B,F.key,C,F.group)}),L&&(M&&M===F.group?F.clone.removeClass("first-in-group"):F.clone.addClass("first-in-group"),M=F.group,F.clone.addClass("group-item"));K=Q,H.onCollectionChange(R,E)}var q,E,H=f[0],I=f[1],J={};w&&(t=function(b,c,d){return B&&(F[B]=b),F[A]=c,F.$index=d,w(a,F)}),D&&(x=function(b,c){return B&&(G[B]=b),G[A]=c,D(a,G)}),B&&(H.keyIdentifier=B),A&&(H.valueIdentifier=A),z&&(H.valueExp=y,q=function(b,c){return B&&(J[B]=b),J[A]=c,z(a,J)});var K=e();"true"===c.deepWatch?(E=!0,a.$watch(C,j,!0)):(E=!1,a.$watchCollection(C,j))}}}}])}();
\ No newline at end of file
+!function(){"use strict";function a(){return++j}function b(a){return a&&a.window===a}function c(a){return"string"==typeof a}function d(a){if(null==a||b(a))return!1;var d=a.length;return 1===a.nodeType&&d?!0:c(a)||Array.isArray(a)||0===d||"number"==typeof d&&d>0&&d-1 in a}function e(){return Object.create(null)}function f(b,c){var d,e=typeof b;return"function"==e||"object"==e&&null!==b?"function"==typeof(d=b.$$hashKey)?d=b.$$hashKey():void 0===d&&(d=b.$$hashKey=(c||a)()):d=b,e+":"+d}function g(a,b,c){var d,e,f=[],g=[];for(d=0;dc;c++)if(v(b,a[c]))return!0;return!1},p=function(a,b){var c,d=a.length;if(0===d)return-1;for(c=0;d>c;c++)if(v(b,a[c]))return c;return-1},q=function(a,b,c){var d,e=a,f=typeof c;if(a==b)return null;do if("string"===f){if(d=" "+e.className+" ",1===e.nodeType&&d.replace(/[\t\r\n\f]/g," ").indexOf(c)>=0)return e}else if(e==c)return e;while((e=e.parentNode)&&e!=b&&9!==e.nodeType);return null},r=function(a){var b,c=a.className.replace(/[\t\r\n\f]/g," ").trim();b=c.split(" ");for(var d=0;dd;d++)if(-1!==c.eq(d).text().toLowerCase().indexOf(b.toLowerCase()))return!0;return!1},u=angular.element,v=angular.equals,w=angular.copy,x=angular.extend,y=angular.module("nya.bootstrap.select",[]);y.provider("nyaBsConfig",function(){var a=null,b={"en-us":{defaultNoneSelection:"Nothing selected",noSearchResult:"NO SEARCH RESULT",numberItemSelected:"%d items selected",selectAll:"Select All",deselectAll:"Deselect All"}},c=w(b);this.setLocalizedText=function(a,b){if(!a)throw new Error("localeId must be a string formatted as languageId-countryId");c[a]||(c[a]={}),c[a]=x(c[a],b)},this.useLocale=function(b){a=b},this.$get=["$locale",function(d){var e;return e=a?c[a]:c[d.id],e||(e=b["en-us"]),e}]}),y.controller("nyaBsSelectCtrl",function(){var a=this;a.keyIdentifier=null,a.valueIdentifier=null,a.isMultiple=!1,a.onCollectionChange=function(){},a.setId=function(b){a.id=b||"id#"+Math.floor(1e4*Math.random())}}),y.directive("nyaBsSelect",["$parse","$document","$timeout","$compile","nyaBsConfig",function(a,b,c,d,e){var f="Nothing selected",g='',h='',j='',k='',l='NO SEARCH RESULT',m='';return{restrict:"ECA",require:["ngModel","nyaBsSelect"],controller:"nyaBsSelectCtrl",compile:function(n,x){n.addClass("btn-group");var y,z,A,B,C,D,E,F,G=function(a){var b;return b=x.titleTpl?u(x.titleTpl):x.title?document.createTextNode(x.title):L.defaultNoneSelectionTpl?u(L.defaultNoneSelectionTpl):L.defaultNoneSelection?document.createTextNode(L.defaultNoneSelection):document.createTextNode(f),a&&(x.titleTpl||L.defaultNoneSelectionTpl)?d(b)(a):b},H=n.children(),I=u(g),J=u(h),K=u(k),L=e,M="undefined"!=typeof x.multiple;for(B=r(n[0]),B.forEach(function(a){/btn-(?:primary|info|success|warning|danger|inverse)/.test(a)&&(n.removeClass(a),I.removeClass("btn-default"),I.addClass(a)),/btn-(?:lg|sm|xs)/.test(a)&&(n.removeClass(a),I.addClass(a))}),K.append(H),C=H.length,D=0;C>D;D++)E=H.eq(D),(E.hasClass("nya-bs-option")||E.attr("nya-bs-option"))&&(E.find("a").attr("tabindex","0"),F=E.attr("value"),angular.isString(F)&&""!==F&&(E.attr("data-value",F),E.removeAttr("value")));return"true"===x.liveSearch&&(y=u(j),x.noSearchTitle?l=l.replace("NO SEARCH RESULT",x.noSearchTitle):x.noSearchTitleTpl?l=l.replace("NO SEARCH RESULT",x.noSearchTitleTpl):L.noSearchResultTpl?l=l.replace("NO SEARCH RESULT",L.noSearchResultTpl):L.noSearchResult&&(l=l.replace("NO SEARCH RESULT",L.noSearchResult)),z=u(l),J.append(y),K.append(z)),"true"===x.actionsBox&&M&&(L.selectAllTpl?m=m.replace("SELECT ALL",L.selectAllTpl):L.selectAll&&(m=m.replace("SELECT ALL",L.selectAll)),L.deselectAllTpl?m=m.replace("DESELECT ALL",L.deselectAllTpl):L.selectAll&&(m=m.replace("DESELECT ALL",L.deselectAll)),A=u(m),J.append(A)),u(I[0].querySelector(".special-title")).append(G()),J.append(K),n.append(I),n.append(J),function(e,f,g,h){function j(){var a,b,c=M.children(),d=c.length;for(a=0;d>a;a++)if(b=c.eq(a),b.hasClass("active")&&b.hasClass("nya-bs-option")&&!b.hasClass("not-match"))return b;return null}function k(a){for(var b,c=a.childNodes,d=c.length,e=0;d>e;e++)if(b=c[e],1===b.nodeType&&"a"===b.tagName.toLowerCase()){b.focus();break}}function l(a){var b;b=a?M.children().eq(0):M.children().eq(M.children().length-1);for(var c=0;c0){c=E.$viewValue,d=Array.isArray(c)?w(c):[];for(var f=0;f\s*(\d+)\s*/))&&(j=parseInt(i[1],10)),"undefined"!=typeof j&&a.length>j)return b.empty(),void(L.numberItemSelectedTpl?b.append(u(L.numberItemSelectedTpl.replace("%d",a.length))):L.numberItemSelected?b.append(document.createTextNode(L.numberItemSelected.replace("%d",a.length))):b.append(document.createTextNode(a.length+" items selected")));for(f=0;m>f;f++)e=l.eq(f),e.hasClass("nya-bs-option")&&(c=x(e),I?Array.isArray(a)&&o(a,c)&&(h=e.attr("title"),h?n.push(document.createTextNode(h)):(n.push(y(e)),p.push(e.data("isolateScope")))):v(a,c)&&(h=e.attr("title"),h?n.push(document.createTextNode(h)):(n.push(y(e)),p.push(e.data("isolateScope")))));if(0===n.length)b.empty(),J.addClass("show-special-title");else if(1===n.length)J.removeClass("show-special-title"),b.empty(),k=p[0]?d(n[0])(p[0]):n[0],b.append(k);else for(J.removeClass("show-special-title"),b.empty(),f=0;fb;b++)if(a=c.eq(b),a.hasClass("nya-bs-option")||a.attr("nya-bs-option")){B=a[0].clientHeight;break}if(/\d+/.test(g.size)){var e=parseInt(g.size,10);M.css("max-height",e*B+"px"),M.css("overflow-y","auto")}}var B,C,D,E=h[0],F=h[1],G=!1,H=a(F.valueExp),I="undefined"!=typeof g.multiple,J=u(f[0].querySelector(".dropdown-toggle")),K=J.next(),M=u(K[0].querySelector(".dropdown-menu.inner")),N=u(K[0].querySelector(".bs-searchbox")),O=u(M[0].querySelector(".no-search-result")),P=u(K[0].querySelector(".bs-actionsbox"));F.valueExp&&(D=function(a,b){return H(a,b)}),F.setId(f.attr("id")),I&&(F.isMultiple=!0,E.$isEmpty=function(a){return!a||0===a.length}),"undefined"!=typeof g.disabled&&e.$watch(g.disabled,function(a){a?(J.addClass("disabled"),J.attr("disabled","disabled"),C=J.attr("tabindex"),J.attr("tabindex","-1"),G=!0):(J.removeClass("disabled"),J.removeAttr("disabled"),C?J.attr("tabindex",C):J.removeAttr("tabindex"),G=!1)}),F.onCollectionChange=function(a,b){var c,d=[],f=!1,g=w(E.$modelValue);if(g){if(Array.isArray(a)&&a.length>0){if(D)for(c=0;ca;a++)b=f.eq(a),b.hasClass("nya-bs-option")&&(t(b.find("a"),d)?(b.removeClass("not-match"),e++):b.addClass("not-match"));0===e?O.addClass("show"):O.removeClass("show")}else{for(a=0;g>a;a++)b=f.eq(a),b.hasClass("nya-bs-option")&&b.removeClass("not-match");O.removeClass("show")}c=l(!0),c&&(f.removeClass("active"),u(c).addClass("active"))}),E.$render=function(){var a,b,c=E.$modelValue,d=M.children(),e=d.length;if("undefined"==typeof c)for(a=0;e>a;a++)d.eq(a).hasClass("nya-bs-option")&&d.eq(a).removeClass("selected");else for(a=0;e>a;a++)d.eq(a).hasClass("nya-bs-option")&&(b=x(d.eq(a)),I?o(c,b)?d.eq(a).addClass("selected"):d.eq(a).removeClass("selected"):v(c,b)?d.eq(a).addClass("selected"):d.eq(a).removeClass("selected"));z()},f.on("keydown",function(a){var b=a.keyCode;if(27===b||13===b||38===b||40===b){if(a.preventDefault(),G)return void a.stopPropagation();var c,d,e,h,i=q(a.target,f[0],J[0]);"true"===g.liveSearch?d=q(a.target,f[0],N[0]):c=q(a.target,f[0],K[0]),i?13!==b&&38!==b&&40!==b||f.hasClass("open")||(a.stopPropagation(),f.addClass("open"),"undefined"==typeof B&&A(),"true"===g.liveSearch?(N.children().eq(0)[0].focus(),h=l(!0),h&&(M.children().removeClass("active"),u(h).addClass("active"))):(h=l(!0),h&&k(h))):c?27===b?(J[0].focus(),f.hasClass("open")&&f.triggerHandler("blur"),f.removeClass("open"),a.stopPropagation()):38===b?(a.stopPropagation(),h=m(a.target.parentNode,"previousSibling"),h?k(h):(h=l(!1),h&&k(h))):40===b?(a.stopPropagation(),h=m(a.target.parentNode,"nextSibling"),h?k(h):(h=l(!0),h&&k(h))):13===b&&(a.stopPropagation(),e=u(a.target.parentNode),e.hasClass("nya-bs-option")&&(r(e),I||J[0].focus())):d&&(27===b?(J[0].focus(),f.removeClass("open"),a.stopPropagation()):38===b?(a.stopPropagation(),e=j(),e&&(h=m(e[0],"previousSibling"),h?(e.removeClass("active"),u(h).addClass("active")):(h=l(!1),h&&(e.removeClass("active"),u(h).addClass("active"))))):40===b?(a.stopPropagation(),e=j(),e&&(h=m(e[0],"nextSibling"),h?(e.removeClass("active"),u(h).addClass("active")):(h=l(!0),h&&(e.removeClass("active"),u(h).addClass("active"))))):13===b&&(e=j(),e&&(r(e),I||J[0].focus())))}}),e.$on("$destroy",function(){M.off(),J.off(),N.off&&N.off(),b.off("click",Q)})}}}}]),y.directive("nyaBsOption",["$parse",function(a){var b=/^\s*(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/;return{restrict:"A",transclude:"element",priority:1e3,terminal:!0,require:["^nyaBsSelect","^ngModel"],compile:function(c,i){var j=i.nyaBsOption,p=document.createComment(" end nyaBsOption: "+j+" "),q=j.match(b);if(!q)throw new Error("invalid expression");var r,s,t,w,x,y=i.value,z=y?a(y):null,A=q[3]||q[1],B=q[2],C=q[4],D=q[5]?a(q[5]):null,E=q[6],F={$id:f},G={};return E?w=a(E):(r=function(a,b){return f(b)},s=function(a){return a}),function(a,b,c,f,i){function j(a){var c,f,j,w,y,z,C,D,F,G,J,L,M,N,O,P=b[0],Q=e(),R=[];if(x&&(L=[]),d(a))z=a,y=t||r;else{y=t||s,z=[];for(var S in a)a.hasOwnProperty(S)&&"$"!=S.charAt(0)&&z.push(S);z.sort()}for(C=z.length,D=new Array(C),c=0;C>c;c++)if(f=a===z?c:z[c],j=a[f],w=y(f,j,c),O={},B&&(O[B]=f),O[A]=j,R.push(O),x&&(G=x(f,j),-1===L.indexOf(G)&&G&&L.push(G)),K[w])F=K[w],delete K[w],x&&(F.group=G),F.key=f,F.value=j,Q[w]=F,D[c]=F;else{if(Q[w])throw D.forEach(function(a){a&&a.scope&&(K[a.id]=a)}),new Error("Duplicates in a select are not allowed. Use 'track by' expression to specify unique keys.");D[c]={id:w,scope:void 0,clone:void 0,key:f,value:j},Q[w]=!0,G&&(D[c].group=G)}L&&L.length>0&&(D=g(D,L,"group"));for(var T in K)F=K[T],N=h(F.clone),N.removeData("isolateScope"),N.remove(),F.scope.$destroy();for(c=0;C>c;c++)F=D[c],F.scope?(J=P,k(F)!=J&&u(P).after(F.clone),P=l(F),m(F.scope,c,A,F.value,B,F.key,C,F.group)):i(function(a,b){n(a,b),F.scope=b;var d=p.cloneNode(!1);a[a.length++]=d,u(P).after(a),a.addClass("nya-bs-option"),j=q?q(F.key,F.value):F.value||F.key,H.isMultiple?Array.isArray(I.$modelValue)&&o(I.$modelValue,j)&&a.addClass("selected"):v(j,I.$modelValue)&&a.addClass("selected"),P=d,F.clone=a,Q[F.id]=F,m(F.scope,c,A,F.value,B,F.key,C,F.group)}),L&&(M&&M===F.group?F.clone.removeClass("first-in-group"):F.clone.addClass("first-in-group"),M=F.group,F.clone.addClass("group-item"));K=Q,H.onCollectionChange(R,E)}var q,E,H=f[0],I=f[1],J={};w&&(t=function(b,c,d){return B&&(F[B]=b),F[A]=c,F.$index=d,w(a,F)}),D&&(x=function(b,c){return B&&(G[B]=b),G[A]=c,D(a,G)}),B&&(H.keyIdentifier=B),A&&(H.valueIdentifier=A),z&&(H.valueExp=y,q=function(b,c){return B&&(J[B]=b),J[A]=c,z(a,J)});var K=e();"true"===c.deepWatch?(E=!0,a.$watch(C,j,!0)):(E=!1,a.$watchCollection(C,j))}}}}])}();
\ No newline at end of file
diff --git a/docs/dist/css/main.css b/docs/dist/css/main.css
index 98775d5..2210ede 100644
--- a/docs/dist/css/main.css
+++ b/docs/dist/css/main.css
@@ -1,5 +1,5 @@
/**
- * @lordfriend/nya-bootstrap-select v2.1.8
+ * @lordfriend/nya-bootstrap-select v2.1.9
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
diff --git a/docs/dist/css/nya-bs-select.css b/docs/dist/css/nya-bs-select.css
index 9d1184f..953c263 100644
--- a/docs/dist/css/nya-bs-select.css
+++ b/docs/dist/css/nya-bs-select.css
@@ -1,5 +1,5 @@
/**
- * @lordfriend/nya-bootstrap-select v2.1.8
+ * @lordfriend/nya-bootstrap-select v2.1.9
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
diff --git a/docs/dist/js/nya-bs-select.js b/docs/dist/js/nya-bs-select.js
index e8506fc..c4313d7 100644
--- a/docs/dist/js/nya-bs-select.js
+++ b/docs/dist/js/nya-bs-select.js
@@ -1,5 +1,5 @@
/**
- * @lordfriend/nya-bootstrap-select v2.1.8
+ * @lordfriend/nya-bootstrap-select v2.1.9
* Copyright 2014 Nyasoft
* Licensed under MIT license
*/
@@ -431,8 +431,8 @@ nyaBsSelect.directive('nyaBsSelect', ['$parse', '$document', '$timeout', '$compi
var ACTIONS_BOX = '' +
'
' +
- '' +
- '' +
+ '' +
+ '' +
'
' +
'
';
diff --git a/package.json b/package.json
index f6c6a35..84c24fa 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@lordfriend/nya-bootstrap-select",
- "version": "2.1.8",
+ "version": "2.1.9",
"description": "An angular directive wraps bootstrap-select",
"repository": {
"type": "git",