diff --git a/core/modules/views/views_ui/js/views-admin.js b/core/modules/views/views_ui/js/views-admin.js index 715fc63..2412fbb 100644 --- a/core/modules/views/views_ui/js/views-admin.js +++ b/core/modules/views/views_ui/js/views-admin.js @@ -1100,10 +1100,16 @@ Drupal.viewsUi.resizeModal = function (e, no_shrink) { Drupal.behaviors.handlerRemoveLink = {}; Drupal.behaviors.handlerRemoveLink.attach = function(context) { - jQuery('a.views-remove-link', context).once('views-processed').click(function(event) { - var id = jQuery(this).attr('id').replace('views-remove-link-', ''); - jQuery('#views-row-' + id).hide(); - jQuery('#views-removed-' + id).attr('checked', true); + var $ = jQuery; + + /** + * Handle handler deletion by looking for the hidden checkbox and hiding the + * row. + */ + $('a.views-remove-link', context).once('views-processed').click(function(event) { + var id = $(this).attr('id').replace('views-remove-link-', ''); + $('#views-row-' + id).hide(); + $('#views-removed-' + id).attr('checked', true); event.preventDefault(); }); @@ -1111,13 +1117,11 @@ Drupal.behaviors.handlerRemoveLink.attach = function(context) { * Handle display deletion by looking for the hidden checkbox and hiding the * row. */ - jQuery('a.display-remove-link', context) - .addClass('display-processed') - .click(function() { - var id = jQuery(this).attr('id').replace('display-remove-link-', ''); - jQuery('#display-row-' + id, context).hide(); - jQuery('#display-removed-' + id, context).attr('checked', true); - return false; + $('a.display-remove-link', context).addClass('display-processed').click(function(event) { + var id = $(this).attr('id').replace('display-remove-link-', ''); + $('#display-row-' + id, context).hide(); + $('#display-removed-' + id, context).attr('checked', true); + event.preventDefault(); }); };