mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(): cleanup unused variables
This commit is contained in:
17
js/angular/controller/listController.js
vendored
17
js/angular/controller/listController.js
vendored
@@ -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();
|
||||
};
|
||||
}]);
|
||||
|
||||
11
js/angular/directive/item.js
vendored
11
js/angular/directive/item.js
vendored
@@ -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) {
|
||||
};
|
||||
}
|
||||
};
|
||||
}]);
|
||||
});
|
||||
|
||||
4
js/angular/directive/itemDeleteButton.js
vendored
4
js/angular/directive/itemDeleteButton.js
vendored
@@ -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
|
||||
};
|
||||
}
|
||||
};
|
||||
}]);
|
||||
});
|
||||
|
||||
2
js/angular/directive/itemReorderButton.js
vendored
2
js/angular/directive/itemReorderButton.js
vendored
@@ -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'],
|
||||
|
||||
3
js/angular/directive/list.js
vendored
3
js/angular/directive/list.js
vendored
@@ -75,9 +75,8 @@
|
||||
*/
|
||||
IonicModule
|
||||
.directive('ionList', [
|
||||
'$animate',
|
||||
'$timeout',
|
||||
function($animate, $timeout) {
|
||||
function($timeout) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
require: ['ionList', '^?$ionicScroll'],
|
||||
|
||||
Reference in New Issue
Block a user