mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 06:57:02 +08:00
List item button event fix
This commit is contained in:
11
dist/js/ionic-angular.js
vendored
11
dist/js/ionic-angular.js
vendored
@ -234,10 +234,11 @@ angular.module('ionic.ui.list', ['ionic.service', 'ngAnimate'])
|
||||
require: '^list',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
scope: true,
|
||||
scope: {
|
||||
item: '=',
|
||||
onSelect: '&',
|
||||
onDelete: '&',
|
||||
onButtonClicked: '&',
|
||||
canDelete: '@',
|
||||
canReorder: '@',
|
||||
canSwipe: '@',
|
||||
@ -250,10 +251,10 @@ angular.module('ionic.ui.list', ['ionic.service', 'ngAnimate'])
|
||||
<div class="list-item-content" ng-transclude>\
|
||||
</div>\
|
||||
<div class="list-item-drag" ng-if="canReorder && isEditing">\
|
||||
<button data-ionic-action="reorder" class="button button-icon" ng-click="startReorder()"><i ng-class="reorderIcon"></i></button>\
|
||||
<button data-ionic-action="reorder" class="button button-icon"><i ng-class="reorderIcon"></i></button>\
|
||||
</div>\
|
||||
<div class="list-item-buttons" ng-if="canSwipe && !isEditing">\
|
||||
<button ng-click="onButtonClicked(button)" class="button" ng-class="button.type" ng-repeat="button in buttons">{{button.text}}</button>\
|
||||
<button ng-click="buttonClicked(button)" class="button" ng-class="button.type" ng-repeat="button in buttons">{{button.text}}</button>\
|
||||
</div>\
|
||||
</li>',
|
||||
link: function($scope, $element, $attr, list) {
|
||||
@ -261,6 +262,10 @@ angular.module('ionic.ui.list', ['ionic.service', 'ngAnimate'])
|
||||
$scope.deleteIcon = list.scope.deleteIcon;
|
||||
$scope.reorderIcon = list.scope.reorderIcon;
|
||||
|
||||
$scope.buttonClicked = function(button) {
|
||||
button.onButtonClicked && button.onButtonClicked($scope.item, button);
|
||||
};
|
||||
|
||||
list.scope.$watch('isEditing', function(v) {
|
||||
$scope.isEditing = v;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user