diff --git a/core/modules/views_ui/js/views_ui.listing.js b/core/modules/views_ui/js/views_ui.listing.js index ee2199f..8be2a88 100644 --- a/core/modules/views_ui/js/views_ui.listing.js +++ b/core/modules/views_ui/js/views_ui.listing.js @@ -51,4 +51,25 @@ } }; + // Enable button fix. + Drupal.behaviors.viewsEnableFocus = { + attach: function (context, settings) { + $('tr.views-ui-list-disabled li.enable .use-ajax', context).on('click', function() { + // Get element title. + var title = $(this).closest('tr').attr('title'); + // Listen for changes on upper DOM lists. + var interval = setInterval(function() { + $('tr.views-ui-list-enabled').each(function() { + var $this = $(this); + // If upper DOM gets updated get element(based on title) and focus it. + if($this.attr('title') == title) { + $this.find('a').focus(); + clearInterval(interval); + } + }); + }, 500); + }); + } + }; + }(jQuery, Drupal));