From 246c193f9a70c450ca51fcea98d2db0d9dac4542 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Mon, 10 Nov 2014 21:06:33 -0600 Subject: [PATCH] chore(): cleanup unused variables --- js/angular/controller/listController.js | 17 ++++++++--------- js/angular/directive/item.js | 11 ++++------- js/angular/directive/itemDeleteButton.js | 4 ++-- js/angular/directive/itemReorderButton.js | 2 +- js/angular/directive/list.js | 3 +-- 5 files changed, 16 insertions(+), 21 deletions(-) diff --git a/js/angular/controller/listController.js b/js/angular/controller/listController.js index a79717c5ff..c0eb7b06f9 100644 --- a/js/angular/controller/listController.js +++ b/js/angular/controller/listController.js @@ -77,39 +77,38 @@ IonicModule .controller('$ionicList', [ '$scope', '$attrs', - '$parse', '$ionicListDelegate', -function($scope, $attrs, $parse, $ionicListDelegate) { - +function($scope, $attrs, $ionicListDelegate) { + var self = this; var isSwipeable = true; var isReorderShown = false; var isDeleteShown = false; - var deregisterInstance = $ionicListDelegate._registerInstance(this, $attrs.delegateHandle); + var deregisterInstance = $ionicListDelegate._registerInstance(self, $attrs.delegateHandle); $scope.$on('$destroy', deregisterInstance); - this.showReorder = function(show) { + self.showReorder = function(show) { if (arguments.length) { isReorderShown = !!show; } return isReorderShown; }; - this.showDelete = function(show) { + self.showDelete = function(show) { if (arguments.length) { isDeleteShown = !!show; } return isDeleteShown; }; - this.canSwipeItems = function(can) { + self.canSwipeItems = function(can) { if (arguments.length) { isSwipeable = !!can; } return isSwipeable; }; - this.closeOptionButtons = function() { - this.listView && this.listView.clearDragEffects(); + self.closeOptionButtons = function() { + self.listView && self.listView.clearDragEffects(); }; }]); diff --git a/js/angular/directive/item.js b/js/angular/directive/item.js index 08ac1ef705..28c8737163 100644 --- a/js/angular/directive/item.js +++ b/js/angular/directive/item.js @@ -28,10 +28,7 @@ var ITEM_TPL_CONTENT = * ``` */ IonicModule -.directive('ionItem', [ - '$animate', - '$compile', -function($animate, $compile) { +.directive('ionItem', function() { return { restrict: 'E', controller: ['$scope', '$element', function($scope, $element) { @@ -41,8 +38,8 @@ function($animate, $compile) { scope: true, compile: function($element, $attrs) { var isAnchor = angular.isDefined($attrs.href) || - angular.isDefined($attrs.ngHref) || - angular.isDefined($attrs.uiSref); + angular.isDefined($attrs.ngHref) || + angular.isDefined($attrs.uiSref); var isComplexItem = isAnchor || //Lame way of testing, but we have to know at compile what to do with the element /ion-(delete|option|reorder)-button/i.test($element.html()); @@ -67,4 +64,4 @@ function($animate, $compile) { }; } }; -}]); +}); diff --git a/js/angular/directive/itemDeleteButton.js b/js/angular/directive/itemDeleteButton.js index 8046733793..d00882ab4b 100644 --- a/js/angular/directive/itemDeleteButton.js +++ b/js/angular/directive/itemDeleteButton.js @@ -30,7 +30,7 @@ var ITEM_TPL_DELETE_BUTTON = * ``` */ IonicModule -.directive('ionDeleteButton', ['$animate', function($animate) { +.directive('ionDeleteButton', function() { return { restrict: 'E', require: ['^ionItem', '^?ionList'], @@ -54,4 +54,4 @@ IonicModule }; } }; -}]); +}); diff --git a/js/angular/directive/itemReorderButton.js b/js/angular/directive/itemReorderButton.js index b73af3018e..6a2d47227b 100644 --- a/js/angular/directive/itemReorderButton.js +++ b/js/angular/directive/itemReorderButton.js @@ -47,7 +47,7 @@ var ITEM_TPL_REORDER_BUTTON = * Parameters given: $fromIndex, $toIndex. */ IonicModule -.directive('ionReorderButton', ['$animate', '$parse', function($animate, $parse) { +.directive('ionReorderButton', ['$parse', function($parse) { return { restrict: 'E', require: ['^ionItem', '^?ionList'], diff --git a/js/angular/directive/list.js b/js/angular/directive/list.js index c4d836b94a..1466edc845 100644 --- a/js/angular/directive/list.js +++ b/js/angular/directive/list.js @@ -75,9 +75,8 @@ */ IonicModule .directive('ionList', [ - '$animate', '$timeout', -function($animate, $timeout) { +function($timeout) { return { restrict: 'E', require: ['ionList', '^?$ionicScroll'],