01/02: prepare directive.js to minify
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See http://git.chorem.org/pollen.git commit 1ae33eba47edf411c5790a4f0c0a34702019706d Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Wed Jul 2 12:45:39 2014 +0200 prepare directive.js to minify --- .../src/main/webapp/js/controllers/pollCtrl.js | 1 - pollen-ui-angular/src/main/webapp/js/directives.js | 96 ++++++++++++---------- 2 files changed, 51 insertions(+), 46 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js index 4f4637a..ae27703 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -184,7 +184,6 @@ angular.module('pollControllers', []) $timeout(function () { $scope.$watch('data.poll.voteCountingType', function (newVal, oldVal) { if (angular.isDefined(oldVal) && (newVal == 1 || oldVal == 1) && newVal != oldVal) { - console.log('vote Change'); angular.forEach($scope.data.votants, function(votant, key) { angular.forEach(votant.choice, function (choice) { choice.inputType = $scope.getInputType(); diff --git a/pollen-ui-angular/src/main/webapp/js/directives.js b/pollen-ui-angular/src/main/webapp/js/directives.js index 051cb75..ad58548 100644 --- a/pollen-ui-angular/src/main/webapp/js/directives.js +++ b/pollen-ui-angular/src/main/webapp/js/directives.js @@ -24,7 +24,7 @@ angular.module('pollenDirective', []) ///// FOCUS ME ///// ////////////////////////////////////// -.directive('focusMe', function($timeout) { +.directive('focusMe', ['$timeout', function($timeout) { return { link: function($scope, element, attrs) { $scope.$watch(attrs.focusMe, function(value) { @@ -37,13 +37,13 @@ angular.module('pollenDirective', []) }); } }; -}) +}]) ////////////////////////////////////// ///// EDIT ME ///// ////////////////////////////////////// -.directive('editMe', function() { +.directive('editMe', [function() { return { restrict:'A', link: function ($scope, element, attrs) { @@ -57,13 +57,13 @@ angular.module('pollenDirective', []) }); } }; -}) +}]) ////////////////////////////////////// ///// CKEDITOR ///// ////////////////////////////////////// -.directive('ckEditor', function ($timeout) { +.directive('ckEditor', ['$timeout', function ($timeout) { return { require: '?ngModel', link: function ($scope, element, attrs, ngModel) { @@ -92,13 +92,13 @@ angular.module('pollenDirective', []) } } }; -}) +}]) ////////////////////////////////////// ///// NG EXIT ///// ////////////////////////////////////// -.directive('ngExit', function ($timeout) { +.directive('ngExit', [ '$timeout', function ($timeout) { return { link: function (scope, element, attrs) { element.bind("keydown keypress", function (event) { @@ -118,13 +118,13 @@ angular.module('pollenDirective', []) }); } }; -}) +}]) ////////////////////////////////////// ///// INFO ERROR ///// ////////////////////////////////////// -.directive('infoError', function() { +.directive('infoError', [function() { return { restrict:'E', scope: { @@ -140,13 +140,13 @@ angular.module('pollenDirective', []) }); } }; -}) +}]) ////////////////////////////////////// ///// INPUT ERROR ///// ////////////////////////////////////// -.directive('inputError', function() { +.directive('inputError', ['$timeout', function($timeout) { return { restrict:'E', scope: { @@ -156,30 +156,32 @@ angular.module('pollenDirective', []) transclude: true, template: '<div tooltip={{error}} ng-transclude></div>', link: function (scope, element, attrs) { - scope.$watch('forData', function (newVal, oldVal) { - if (newVal != oldVal) { - delete scope.error; - } - }); - scope.$watch('error', function (newVal, oldVal) { - attrs.tooltip = newVal; - if (angular.isDefined(newVal)) { - $(element[0]).addClass('has-error'); + $timeout(function () { + scope.$watch('forData', function (newVal, oldVal) { + if (newVal != oldVal) { + delete scope.error; + } + }); + scope.$watch('error', function (newVal, oldVal) { + attrs.tooltip = newVal; + if (angular.isDefined(newVal)) { + $(element[0]).addClass('has-error'); - } - else { - $(element[0]).removeClass('has-error'); - } - }) + } + else { + $(element[0]).removeClass('has-error'); + } + }) + }); } }; -}) +}]) ////////////////////////////////////// ///// SELECT ON CLICK ///// ////////////////////////////////////// -.directive('selectOnClick', function () { +.directive('selectOnClick', [function () { return { restrict: 'A', link: function (scope, element, attrs) { @@ -188,13 +190,13 @@ angular.module('pollenDirective', []) }); } }; -}) +}]) ////////////////////////////////////// ///// AUTO SAVE ///// ////////////////////////////////////// -.directive('autoSave', function ($timeout) { +.directive('autoSave', ['$timeout', function ($timeout) { return { restrict : 'A', link : function (scope, element, attrs) { @@ -237,13 +239,13 @@ angular.module('pollenDirective', []) }); } } -}) +}]) ////////////////////////////////////// ///// MAKE PAGINATION ///// ////////////////////////////////////// -.directive('makePagination', function () { +.directive('makePagination', ['$timeout', function ($timeout) { return { restrict: 'E', scope: { @@ -269,12 +271,14 @@ angular.module('pollenDirective', []) //set pageList scope.pageList = []; - scope.$watch('lastPage', function (newVal) { - scope.pageList = []; - for (var i = 0; i <= newVal; i++) { - scope.pageList.push(i); - } - setNavPage(); + $timeout(function () { + scope.$watch('lastPage', function (newVal) { + scope.pageList = []; + for (var i = 0; i <= newVal; i++) { + scope.pageList.push(i); + } + setNavPage(); + }); }); scope.goPage = function (pageNumber) { @@ -283,13 +287,13 @@ angular.module('pollenDirective', []) }; } } -}) +}]) ////////////////////////////////////// ///// JQPLOT CHART ///// ////////////////////////////////////// -.directive('chart', function ($timeout) { +.directive('chart', ['$timeout', function ($timeout) { return { restrict : 'E', scope : { @@ -346,13 +350,13 @@ angular.module('pollenDirective', []) }); } } -}) +}]) ////////////////////////////////////// ///// JQPLOT PIE ///// ////////////////////////////////////// -.directive('pie', function ($timeout) { +.directive('pie', ['$timeout', function ($timeout) { return { restrict : 'E', scope : { @@ -387,9 +391,11 @@ angular.module('pollenDirective', []) } }; - scope.$watch('data', function () { - initChart(); - }); + $timeout(function () { + scope.$watch('data', function () { + initChart(); + }); + }) } } -}) \ No newline at end of file +}]) \ No newline at end of file -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm