diff --git a/dist/angular-chosen.js b/dist/angular-chosen.js index 5c16f17..514dbef 100644 --- a/dist/angular-chosen.js +++ b/dist/angular-chosen.js @@ -70,7 +70,7 @@ var defaultText, dropListDom; if (chosen) { dropListDom = $(element.parent()).find("div.chosen-drop"); - if (dropListDom && dropListDom.length > 0 && dropListDom.css("left").indexOf("0") >= 0) { + if (dropListDom && dropListDom.length > 0 && parseInt(dropListDom.css("left")) >= 0) { return; } return element.trigger('chosen:updated'); diff --git a/dist/angular-chosen.min.js b/dist/angular-chosen.min.js index f8646fd..ff849c8 100644 --- a/dist/angular-chosen.min.js +++ b/dist/angular-chosen.min.js @@ -4,4 +4,4 @@ * @link http://github.com/leocaseiro/angular-chosen * @license MIT */ -(function(){var e=[].indexOf||function(e){for(var t=0,n=this.length;t=0)return o.$observe(r,function(e){var t;return t=String(l.attr(o.$attr[r])).slice(0,2),p[s(r)]="{{"===t?e:a.$eval(e),y()})}),b=function(){return l.addClass("loading").attr("disabled",!0).trigger("chosen:updated")},v=function(){return l.removeClass("loading"),angular.isDefined(o.disabled)?l.attr("disabled",o.disabled):l.attr("disabled",!1),l.trigger("chosen:updated")},d=null,c=!1,f=function(){var e,t;if(d){if(t=$(l.parent()).find("div.chosen-drop"),t&&t.length>0&&t.css("left").indexOf("0")>=0)return;return l.trigger("chosen:updated")}if(a.$evalAsync(function(){d=l.chosen(p).data("chosen")}),angular.isObject(d))return e=d.default_text},y=function(){return d&&c?l.attr("data-placeholder",d.results_none_found).attr("disabled",!0):l.removeAttr("data-placeholder"),l.trigger("chosen:updated")},u?(g=u.$render,u.$render=function(){return g(),f()},l.on("chosen:hiding_dropdown",function(){return a.$apply(function(){return u.$setTouched()})}),o.multiple&&(w=function(){return u.$viewValue},a.$watch(w,u.$render,!0))):f(),o.$observe("disabled",function(){return l.trigger("chosen:updated")}),o.ngOptions&&u)return h=o.ngOptions.match(r),S=h[7],a.$watchCollection(S,function(e,n){var r;return r=t(function(){return angular.isUndefined(e)?b():(c=i(e),v(),y())})}),a.$on("$destroy",function(e){if("undefined"!=typeof timer&&null!==timer)return t.cancel(timer)})}}}])}).call(this); \ No newline at end of file +(function(){var e=[].indexOf||function(e){for(var t=0,n=this.length;t=0)return o.$observe(r,function(e){var t;return t=String(l.attr(o.$attr[r])).slice(0,2),p[s(r)]="{{"===t?e:a.$eval(e),y()})}),b=function(){return l.addClass("loading").attr("disabled",!0).trigger("chosen:updated")},v=function(){return l.removeClass("loading"),angular.isDefined(o.disabled)?l.attr("disabled",o.disabled):l.attr("disabled",!1),l.trigger("chosen:updated")},d=null,c=!1,f=function(){var e,t;if(d){if(t=$(l.parent()).find("div.chosen-drop"),t&&t.length>0&&parseInt(t.css("left"))>=0)return;return l.trigger("chosen:updated")}if(a.$evalAsync(function(){d=l.chosen(p).data("chosen")}),angular.isObject(d))return e=d.default_text},y=function(){return d&&c?l.attr("data-placeholder",d.results_none_found).attr("disabled",!0):l.removeAttr("data-placeholder"),l.trigger("chosen:updated")},u?(g=u.$render,u.$render=function(){return g(),f()},l.on("chosen:hiding_dropdown",function(){return a.$apply(function(){return u.$setTouched()})}),o.multiple&&(w=function(){return u.$viewValue},a.$watch(w,u.$render,!0))):f(),o.$observe("disabled",function(){return l.trigger("chosen:updated")}),o.ngOptions&&u)return h=o.ngOptions.match(r),S=h[7],a.$watchCollection(S,function(e,n){var r;return r=t(function(){return angular.isUndefined(e)?b():(c=i(e),v(),y())})}),a.$on("$destroy",function(e){if("undefined"!=typeof timer&&null!==timer)return t.cancel(timer)})}}}])}).call(this); \ No newline at end of file diff --git a/src/chosen.coffee b/src/chosen.coffee index ec3af63..1e0b1ca 100644 --- a/src/chosen.coffee +++ b/src/chosen.coffee @@ -78,7 +78,7 @@ angular.module('localytics.directives').directive 'chosen', ['$timeout', ($timeo if chosen # Fix #56 Don't scroll to top when selecting multiple items with ctrl dropListDom = $(element.parent()).find("div.chosen-drop") #uses jQuery instead of Angular. - if dropListDom && dropListDom.length > 0 && dropListDom.css("left").indexOf("0") >= 0 + if dropListDom && dropListDom.length > 0 && parseInt(dropListDom.css("left")) >= 0 return return element.trigger('chosen:updated') else