chore(): cleanup unused variables

This commit is contained in:
Adam Bradley
2014-11-10 21:06:33 -06:00
parent 348282be5a
commit 246c193f9a
5 changed files with 16 additions and 21 deletions

View File

@@ -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();
};
}]);

View File

@@ -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) {
};
}
};
}]);
});

View File

@@ -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
};
}
};
}]);
});

View File

@@ -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'],

View File

@@ -75,9 +75,8 @@
*/
IonicModule
.directive('ionList', [
'$animate',
'$timeout',
function($animate, $timeout) {
function($timeout) {
return {
restrict: 'E',
require: ['ionList', '^?$ionicScroll'],