mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
Fixed list item edit icon and options exposed issue for #76
Still needs work on the border issue @adamdbradley
This commit is contained in:
17
dist/js/ionic-angular.js
vendored
17
dist/js/ionic-angular.js
vendored
@ -487,7 +487,7 @@ angular.module('ionic.ui.content', [])
|
||||
|
||||
angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
|
||||
.directive('listItem', function() {
|
||||
.directive('listItem', ['$timeout', function($timeout) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
require: ['?^list', '?^virtualList'],
|
||||
@ -508,7 +508,7 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
</div>\
|
||||
<div class="item-content slide-left" ng-transclude>\
|
||||
</div>\
|
||||
<div class="item-options" ng-if="canSwipe && !isEditing">\
|
||||
<div class="item-options" ng-if="canSwipe && !isEditing && showOptions">\
|
||||
<button ng-click="buttonClicked(button)" class="button" ng-class="button.type" ng-repeat="button in buttons">{{button.text}}</button>\
|
||||
</div>\
|
||||
</a>',
|
||||
@ -538,6 +538,7 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
$scope.isEditing = false;
|
||||
$scope.deleteIcon = list.scope.deleteIcon;
|
||||
$scope.reorderIcon = list.scope.reorderIcon;
|
||||
$scope.showOptions = true;
|
||||
|
||||
$scope.buttonClicked = function(button) {
|
||||
button.onButtonClicked && button.onButtonClicked($scope.item, button);
|
||||
@ -545,10 +546,20 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
|
||||
list.scope.$watch('isEditing', function(v) {
|
||||
$scope.isEditing = v;
|
||||
|
||||
// Add a delay before we allow the options layer to show, to avoid any odd
|
||||
// animation issues
|
||||
if(!v) {
|
||||
$timeout(function() {
|
||||
$scope.showOptions = true;
|
||||
}, 200);
|
||||
} else {
|
||||
$scope.showOptions = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
})
|
||||
}])
|
||||
|
||||
.directive('list', function() {
|
||||
return {
|
||||
|
||||
17
js/ext/angular/src/directive/ionicList.js
vendored
17
js/ext/angular/src/directive/ionicList.js
vendored
@ -3,7 +3,7 @@
|
||||
|
||||
angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
|
||||
.directive('listItem', function() {
|
||||
.directive('listItem', ['$timeout', function($timeout) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
require: ['?^list', '?^virtualList'],
|
||||
@ -24,7 +24,7 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
</div>\
|
||||
<div class="item-content slide-left" ng-transclude>\
|
||||
</div>\
|
||||
<div class="item-options" ng-if="canSwipe && !isEditing">\
|
||||
<div class="item-options" ng-if="canSwipe && !isEditing && showOptions">\
|
||||
<button ng-click="buttonClicked(button)" class="button" ng-class="button.type" ng-repeat="button in buttons">{{button.text}}</button>\
|
||||
</div>\
|
||||
</a>',
|
||||
@ -54,6 +54,7 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
$scope.isEditing = false;
|
||||
$scope.deleteIcon = list.scope.deleteIcon;
|
||||
$scope.reorderIcon = list.scope.reorderIcon;
|
||||
$scope.showOptions = true;
|
||||
|
||||
$scope.buttonClicked = function(button) {
|
||||
button.onButtonClicked && button.onButtonClicked($scope.item, button);
|
||||
@ -61,10 +62,20 @@ angular.module('ionic.ui.list', ['ngAnimate'])
|
||||
|
||||
list.scope.$watch('isEditing', function(v) {
|
||||
$scope.isEditing = v;
|
||||
|
||||
// Add a delay before we allow the options layer to show, to avoid any odd
|
||||
// animation issues
|
||||
if(!v) {
|
||||
$timeout(function() {
|
||||
$scope.showOptions = true;
|
||||
}, 200);
|
||||
} else {
|
||||
$scope.showOptions = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
})
|
||||
}])
|
||||
|
||||
.directive('list', function() {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user