From 6c045b58a444002f929fa3b1c2afc2bf4c092eee Mon Sep 17 00:00:00 2001 From: Arjan Kempes Date: Tue, 27 Jun 2017 00:57:34 +0200 Subject: [PATCH] Fixes #14 Removed unnecessary module variable --- bower.json | 2 +- dist/ng-rateit.js | 3 +-- dist/ng-rateit.min.js | 2 +- package.json | 2 +- src/ng-rateit.js | 3 +-- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bower.json b/bower.json index 9599d84..e90911a 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-rateit", - "version": "3.0.3", + "version": "3.0.4", "homepage": "https://github.com/akempes/angular-rateit", "authors": [ "Arjan Kempes " diff --git a/dist/ng-rateit.js b/dist/ng-rateit.js index 38b66a6..e3a0f07 100644 --- a/dist/ng-rateit.js +++ b/dist/ng-rateit.js @@ -1,6 +1,5 @@ -var module = angular.module('ngRateIt', ['ng']); +angular.module('ngRateIt', []) -module .directive('ngRateIt', ["$q", function( $q ) { 'use strict'; diff --git a/dist/ng-rateit.min.js b/dist/ng-rateit.min.js index e3a3569..b21c733 100644 --- a/dist/ng-rateit.min.js +++ b/dist/ng-rateit.min.js @@ -1 +1 @@ -var module=angular.module("ngRateIt",["ng"]);module.directive("ngRateIt",["$q",function(a){"use strict";var b=function(b,c,d){d.readOnly||(b.readOnly=function(){return!1}),d.resetable||(b.resetable=function(){return!0}),d.beforeRated||(b.beforeRated=function(){var b=a.defer();return b.resolve(),b.promise}),d.rated||(b.rated=function(){}),d.beforeReset||(b.beforeReset=function(){var b=a.defer();return b.resolve(),b.promise}),d.reset||(b.reset=function(){})};return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"=?rated",reset:"=?reset",beforeRated:"=?beforeRated",beforeReset:"=?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:b,controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(a,b){"use strict";a.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,a.orgValue=angular.copy(a.ngModel),a.min=a.min||0,a.max=a.max||5,a.step=a.step||.5,a.pristine=a.orgValue===a.ngModel,a.starWidth=a.starWidth||16,a.starPartWidth=a.starWidth*a.step,a.starHeight=a.starHeight||16,a.canelWidth=a.canelWidth||a.starWidth,a.cancelHeight=a.cancelHeight||a.starHeight;var c=a.max-a.min,d=c/a.step,e=a.$watch("ngModel",function(){a.pristine=a.orgValue===a.ngModel}),f=function(a){return(a+1)/d*c};a.getStartParts=function(){return new Array(d)},a.getStarOffset=function(b){var c=1/a.step,d=-(a.starWidth/c)*(b%c);return d},a.isSelected=function(b){return f(b)<=a.ngModel-a.min},a.removeRating=function(){a.resetable()&&!a.readOnly()&&a.beforeReset().then(function(){a.ngModel=a.min,a.reset()})},a.setValue=function(c){if(!a.readOnly()){var d=angular.copy(a.min+f(c));a.beforeRated(d).then(function(){a.ngModel=d,b(function(){a.rated()})})}},a.$on("$destroy",function(){e()})}]).run(["$templateCache",function(a){"use strict";a.put("ngRateIt/ng-rate-it.html",'
")}]); \ No newline at end of file +angular.module("ngRateIt",[]).directive("ngRateIt",["$q",function(a){"use strict";var b=function(b,c,d){d.readOnly||(b.readOnly=function(){return!1}),d.resetable||(b.resetable=function(){return!0}),d.beforeRated||(b.beforeRated=function(){var b=a.defer();return b.resolve(),b.promise}),d.rated||(b.rated=function(){}),d.beforeReset||(b.beforeReset=function(){var b=a.defer();return b.resolve(),b.promise}),d.reset||(b.reset=function(){})};return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"=?rated",reset:"=?reset",beforeRated:"=?beforeRated",beforeReset:"=?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:b,controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(a,b){"use strict";a.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,a.orgValue=angular.copy(a.ngModel),a.min=a.min||0,a.max=a.max||5,a.step=a.step||.5,a.pristine=a.orgValue===a.ngModel,a.starWidth=a.starWidth||16,a.starPartWidth=a.starWidth*a.step,a.starHeight=a.starHeight||16,a.canelWidth=a.canelWidth||a.starWidth,a.cancelHeight=a.cancelHeight||a.starHeight;var c=a.max-a.min,d=c/a.step,e=a.$watch("ngModel",function(){a.pristine=a.orgValue===a.ngModel}),f=function(a){return(a+1)/d*c};a.getStartParts=function(){return new Array(d)},a.getStarOffset=function(b){var c=1/a.step,d=-(a.starWidth/c)*(b%c);return d},a.isSelected=function(b){return f(b)<=a.ngModel-a.min},a.removeRating=function(){a.resetable()&&!a.readOnly()&&a.beforeReset().then(function(){a.ngModel=a.min,a.reset()})},a.setValue=function(c){if(!a.readOnly()){var d=angular.copy(a.min+f(c));a.beforeRated(d).then(function(){a.ngModel=d,b(function(){a.rated()})})}},a.$on("$destroy",function(){e()})}]).run(["$templateCache",function(a){"use strict";a.put("ngRateIt/ng-rate-it.html",'
")}]); \ No newline at end of file diff --git a/package.json b/package.json index 55da99e..0a02a4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-rateit", - "version": "3.0.3", + "version": "3.0.4", "dependencies": {}, "repository": { "type": "git", diff --git a/src/ng-rateit.js b/src/ng-rateit.js index 38b66a6..e3a0f07 100644 --- a/src/ng-rateit.js +++ b/src/ng-rateit.js @@ -1,6 +1,5 @@ -var module = angular.module('ngRateIt', ['ng']); +angular.module('ngRateIt', []) -module .directive('ngRateIt', ["$q", function( $q ) { 'use strict';