summaryrefslogtreecommitdiffstats
path: root/angular-multi-select.min.js
diff options
context:
space:
mode:
authoristeven <isteven@server.fake>2014-05-07 14:16:38 +0800
committeristeven <isteven@server.fake>2014-05-07 14:16:38 +0800
commitd045bb2e47e40a8dfe1b53b11b842fbcbdd4ac2a (patch)
tree37753bb6aabb6160b9abe831961546a28e89b0f2 /angular-multi-select.min.js
parent059209d4b812c346d3eae5e44c59a966dfbdd560 (diff)
downloadangular-multi-select-d045bb2e47e40a8dfe1b53b11b842fbcbdd4ac2a.zip
angular-multi-select-d045bb2e47e40a8dfe1b53b11b842fbcbdd4ac2a.tar.gz
angular-multi-select-d045bb2e47e40a8dfe1b53b11b842fbcbdd4ac2a.tar.bz2
added minified version
Diffstat (limited to 'angular-multi-select.min.js')
-rw-r--r--angular-multi-select.min.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/angular-multi-select.min.js b/angular-multi-select.min.js
new file mode 100644
index 0000000..aeda51d
--- /dev/null
+++ b/angular-multi-select.min.js
@@ -0,0 +1,8 @@
+angular.B("multi-select",["ng"]).v("multiSelect",["$sce",function(f){return{C:"AE",replace:!0,scope:{a:"=",n:"=",u:"@",h:"@",p:"@",b:"@",i:"@",orientation:"@",f:"@",m:"=",e:"@"},F:'<span class="multiSelect inlineBlock"><button type="button" class="multiSelect button multiSelectButton" ng-click="toggleCheckboxes( $event ); refreshSelectedItems();" ng-bind-html="varButtonLabel"></button><div class="multiSelect checkboxLayer hide"><div class="multiSelect line"><span ng-if="!isDisabled">Select: &nbsp;</span><button type="button" ng-click="select( \'all\' )" class="multiSelect helperButton" ng-if="!isDisabled && selectionMode.toUpperCase() != \'SINGLE\'">All</button> <button type="button" ng-click="select( \'none\' )" class="multiSelect helperButton" ng-if="!isDisabled && selectionMode.toUpperCase() != \'SINGLE\'">None</button> <button type="button" ng-click="select( \'reset\' )" class="multiSelect helperButton" ng-if="!isDisabled">Reset</button></div><div class="multiSelect line">Filter: <input class="multiSelect" type="text" ng-model="labelFilter" />&nbsp;<button type="button" class="multiSelect helperButton" ng-click="labelFilter=\'\'">Clear</button></div><div ng-repeat="item in inputModel | filter:labelFilter" ng-class="orientation" class="multiSelect multiSelectItem"><div class="multiSelect acol"><div class="multiSelect" ng-show="item[ tickProperty ]">&#10004;</div></div><div class="multiSelect acol"><label class="multiSelect" ng-class="{checkboxSelected:item[ tickProperty ]}"><input class="multiSelect checkbox" type="checkbox" ng-disabled="itemIsDisabled( item )" ng-checked="item[ tickProperty ]" ng-click="syncItems( item, $event )" /><span class="multiSelect" ng-class="{disabled:itemIsDisabled( item )}" ng-bind-html="writeLabel( item, \'itemLabel\' )"></span></label>&nbsp;&nbsp;</div></div></div></span>',
+link:function(a,h,e){a.d=[];a.j=[];a.c="";a.D=function(c,b){index=a.a.indexOf(c);a.a[index][a.b]=!a.a[index][a.b];if(e.h&&"SINGLE"===a.h.toUpperCase()){a.a[index][a.b]=!0;for(i=0;i<a.a.length;i++)i!==index&&(a.a[i][a.b]=!1);a.r(b)}a.g()};a.g=function(){a.c="";a.d=[];ctr=0;angular.forEach(a.a,function(b){"undefined"!==typeof b&&(!0!==b[a.b]&&"true"!==b[a.b]||a.d.push(b))});"undefined"!==typeof e.n&&(a.n=angular.k(a.d));if(0===a.d.length)a.c="None selected";else{var c=a.d.length;"undefined"!==typeof a.f&&
+""!==a.f&&"0"!==a.f&&(c=a.f);a.q=a.d.length>c?!0:!1;angular.forEach(a.d,function(b){"undefined"!==typeof b&&(ctr<c&&(a.c+=(0<a.c.length?", ":"")+a.t(b)),ctr++)});!0===a.q&&(a.c+=", ... (Total: "+a.d.length+")")}a.c=f.s(a.c+'<span class="multiSelect caret"></span>')};a.w=function(c){return!0===c[a.i]?!0:!0===a.m?!0:!1};a.t=function(c){var b="";angular.forEach(a.buttonLabel.split(" "),function(a){"undefined"!==typeof a&&angular.forEach(c,function(c,e){e==a&&(b+=" "+c)})});return f.s(b)};a.r=function(c){c.target&&
+("BUTTON"!==c.target.tagName.toUpperCase()&&0>c.target.className.indexOf("multiSelectButton")?e.h&&"SINGLE"===a.h.toUpperCase()?"INPUT"===c.target.tagName.toUpperCase()&&(c=a.l(c.target,"div","checkboxLayer"),c=c.previousSibling):c=a.l(c.target,"button","multiSelectButton"):c=c.target);a.A="";var b=-1,d=document.querySelectorAll(".checkboxLayer"),g=document.querySelectorAll(".multiSelectButton");for(i=0;i<g.length;i++)if(c===g[i]){b=i;break}if(-1<b){for(i=0;i<d.length;i++)i!=b&&(d[i].className="multiSelect checkboxLayer hide");
+"multiSelect checkboxLayer hide"==d[b].className?d[b].className="multiSelect checkboxLayer show":"multiSelect checkboxLayer show"==d[b].className&&(d[b].className="multiSelect checkboxLayer hide")}};a.l=function(a,b,d){for(;a.parentNode;)if(a=a.parentNode,"undefined"!==typeof a.tagName&&a.tagName.toUpperCase()===b.toUpperCase()&&-1<a.className.indexOf(d))return a;return null};a.select=function(c){switch(c.toUpperCase()){case "ALL":angular.forEach(a.a,function(b){"undefined"!==typeof b&&!0!==b[a.i]&&
+(b[a.b]=!0)});break;case "NONE":angular.forEach(a.a,function(b){"undefined"!==typeof b&&!0!==b[a.i]&&(b[a.b]=!1)});break;case "RESET":a.a=angular.k(a.j)}a.g()};validate=function(){"inputModel"in e||console.log("Multi-select error: input-model is not defined! (ID: "+a.e+")");"buttonLabel"in e||console.log("Multi-select error: button-label is not defined! (ID: "+a.e+")");"itemLabel"in e||console.log("Multi-select error: item-label is not defined! (ID: "+a.e+")");"tickProperty"in e||console.log("Multi-select error: tick-property is not defined! (ID: "+
+a.e+")")};validateProperties=function(c,b){var d=!1;angular.forEach(c,function(a){if("undefined"!==typeof a){var c=!0;angular.forEach(b,function(b){"undefined"===typeof b||!c||a in b||(d=!0,c=!1,missingLabel=a)})}});!0===d&&console.log('Multi-select error: property "'+missingLabel+'" is not available in the input model. (Name: '+a.e+")")};validate();a.g();a.o("inputModel",function(){"undefined"!==a.a&&(validateProperties(a.p.split(" "),a.a),validateProperties(Array(a.b),a.a));a.j=angular.k(a.a);a.g()});
+a.o("isDisabled",function(c){a.m=c});angular.element(document);Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var d=this.length;b<d;){if(this[b]===a)return b;++b}return-1})}}}]);