forked from adityasharat/angular-chosen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-chosen.min.js
1 lines (1 loc) · 1.02 KB
/
angular-chosen.min.js
1
(function(e){var t=e.module("angular.chosen",[]);t.directive("chosen",function(){var e,t,n,r;e=[{onChange:"change"},{onReady:"chosen:ready"},{onMaxSelected:"chosen:maxselected"},{onShowDropdown:"chosen:showing_dropdown"},{onHideDropdown:"chosen:hiding_dropdown"},{onNoResult:"chosen:no_results"}];t={options:"=",ngModel:"=",ngDisabled:"="};r=[];Object.keys(t).forEach(function(e){r.push(e)});e.forEach(function(e){var n=Object.keys(e)[0];t[n]="="});n=function(t,n,i){var s=parseInt(i.maxSelection,10),o=parseInt(i.searchThreshold,10);if(isNaN(s)||s===Infinity){s=undefined}if(isNaN(o)||o===Infinity){o=undefined}n.chosen({width:"100%",max_selected_options:s,disable_search_threshold:o,search_contains:true});n.on("change",function(){n.trigger("chosen:updated")});t.$watchGroup(r,function(){setTimeout(function(){n.trigger("chosen:updated")},100)});e.forEach(function(e){var r=Object.keys(e)[0];if(typeof t[r]==="function"){n.on(e[r],function(e){t.$apply(function(){t[r](e)})})}})};return{name:"chosen",scope:t,restrict:"A",link:n}})})(angular)