From e40387ff45b19fce4ca4a1f5c06d0bee5400348f Mon Sep 17 00:00:00 2001 From: leocaseiro Date: Mon, 4 Jul 2016 23:50:44 +1000 Subject: [PATCH] fix(Disable Mobile): Disable Chosen for mobile as recommended for Chosen team - v.1.4.2 --- dist/angular-chosen.js | 4 ++-- dist/angular-chosen.min.js | 4 ++-- example/index.html | 4 ++-- package.json | 2 +- src/chosen.coffee | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/angular-chosen.js b/dist/angular-chosen.js index 4d2c3c3..f0037b7 100644 --- a/dist/angular-chosen.js +++ b/dist/angular-chosen.js @@ -1,6 +1,6 @@ /** * angular-chosen-localytics - Angular Chosen directive is an AngularJS Directive that brings the Chosen jQuery in a Angular way - * @version v1.4.1 + * @version v1.4.2 * @link http://github.com/leocaseiro/angular-chosen * @license MIT */ @@ -80,7 +80,7 @@ } }; updateMessage = function() { - if (empty) { + if (chosen && empty) { element.attr('data-placeholder', chosen.results_none_found).attr('disabled', true); } else { element.removeAttr('data-placeholder'); diff --git a/dist/angular-chosen.min.js b/dist/angular-chosen.min.js index 5bd951a..036845a 100644 --- a/dist/angular-chosen.min.js +++ b/dist/angular-chosen.min.js @@ -1,7 +1,7 @@ /** * angular-chosen-localytics - Angular Chosen directive is an AngularJS Directive that brings the Chosen jQuery in a Angular way - * @version v1.4.1 + * @version v1.4.2 * @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),S()})}),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;return d?l.trigger("chosen:updated"):(t(function(){d=l.chosen(p).data("chosen")}),angular.isObject(d)?e=d.default_text:void 0)},S=function(){return 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),y=h[7],a.$watchCollection(y,function(e,n){var r;return r=t(function(){return angular.isUndefined(e)?b():(c=i(e),v(),S())})}),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),S()})}),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;return d?l.trigger("chosen:updated"):(t(function(){d=l.chosen(p).data("chosen")}),angular.isObject(d)?e=d.default_text:void 0)},S=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),y=h[7],a.$watchCollection(y,function(e,n){var r;return r=t(function(){return angular.isUndefined(e)?b():(c=i(e),v(),S())})}),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/example/index.html b/example/index.html index 055fb43..fd7b6a5 100644 --- a/example/index.html +++ b/example/index.html @@ -3,12 +3,12 @@ - + - +