mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(ionList): allow scrolling while reorder or delete is active
Closes #1703
This commit is contained in:
26
js/angular/directive/list.js
vendored
26
js/angular/directive/list.js
vendored
@@ -140,9 +140,12 @@ function($animate, $timeout) {
|
||||
if (isShown) listCtrl.closeOptionButtons();
|
||||
listCtrl.canSwipeItems(!isShown);
|
||||
|
||||
var deleteButton = jqLite($element[0].getElementsByClassName('item-delete'));
|
||||
|
||||
$element.children().toggleClass('list-left-editing', isShown);
|
||||
toggleNgHide('.item-delete.item-left-edit', isShown);
|
||||
toggleTapDisabled('.item-content', isShown);
|
||||
toggleNgHide(deleteButton, isShown);
|
||||
|
||||
$element.toggleClass('disable-pointer-events', isShown);
|
||||
});
|
||||
$scope.$watch(function() {
|
||||
return listCtrl.showReorder();
|
||||
@@ -153,13 +156,16 @@ function($animate, $timeout) {
|
||||
if (isShown) listCtrl.closeOptionButtons();
|
||||
listCtrl.canSwipeItems(!isShown);
|
||||
|
||||
var reorderButton = jqLite($element[0].getElementsByClassName('item-reorder'));
|
||||
|
||||
$element.children().toggleClass('list-right-editing', isShown);
|
||||
toggleNgHide('.item-reorder.item-right-edit', isShown);
|
||||
toggleTapDisabled('.item-content', isShown);
|
||||
toggleNgHide(reorderButton, isShown);
|
||||
|
||||
$element.toggleClass('disable-pointer-events', isShown);
|
||||
});
|
||||
|
||||
function toggleNgHide(selector, shouldShow) {
|
||||
forEach($element[0].querySelectorAll(selector), function(node) {
|
||||
function toggleNgHide(element, shouldShow) {
|
||||
forEach(element, function(node) {
|
||||
if (shouldShow) {
|
||||
$animate.removeClass(jqLite(node), 'ng-hide');
|
||||
} else {
|
||||
@@ -167,14 +173,6 @@ function($animate, $timeout) {
|
||||
}
|
||||
});
|
||||
}
|
||||
function toggleTapDisabled(selector, shouldDisable) {
|
||||
var el = jqLite($element[0].querySelectorAll(selector));
|
||||
if (shouldDisable) {
|
||||
el.attr('data-tap-disabled', 'true');
|
||||
} else {
|
||||
el.removeAttr('data-tap-disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user