diff --git a/1848940_enableFix.patch b/1848940_enableFix.patch deleted file mode 100644 index 5b34428..0000000 --- a/1848940_enableFix.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/core/modules/views_ui/js/views_ui.listing.js b/core/modules/views_ui/js/views_ui.listing.js -index ee2199f..30d60e2 100644 ---- a/core/modules/views_ui/js/views_ui.listing.js -+++ b/core/modules/views_ui/js/views_ui.listing.js -@@ -51,4 +51,31 @@ - } - }; - -+ //Enable button fix -+ Drupal.behaviors.viewsEnableFix = { -+ attach: function (context, settings) { -+ String.prototype.endsWith = function(str){return (this.match(str+"$")==str)}; -+ -+ if(window.location.href.endsWith('/admin/structure/views')==true){ -+ -+ $('tr.views-ui-list-disabled li.enable .use-ajax', context).on('click', function(){ -+ var title=$(this).closest('tr').attr('title');// Get element title -+ var interval=setInterval(function(){ // Listen for changes on upper DOM lists -+ -+ var trs=$('tr.views-ui-list-enabled'); -+ trs.each(function(i){ -+ if($(this).attr('title')==title){// If upper DOM gets updated get element(based on title) and scrool to it -+ $('html, body').animate({scrollTop: Math.round($(this).offset().top)-$(this).innerHeight() },'fast'); -+ $(this).find('a').focus(); -+ clearInterval(interval); -+ } -+ }); -+ -+ },500); -+ -+ });// on click end -+ }// if location end -+ }// attach end -+ }; -+ - }(jQuery, Drupal)); diff --git a/core/modules/views_ui/js/views_ui.listing.js b/core/modules/views_ui/js/views_ui.listing.js index ee2199f..cd09979 100644 --- a/core/modules/views_ui/js/views_ui.listing.js +++ b/core/modules/views_ui/js/views_ui.listing.js @@ -51,4 +51,22 @@ } }; + //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() { + var trs = $('tr.views-ui-list-enabled'); + trs.each(function(i) { + // 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)); diff --git a/interdiff-1848940-11-15.txt b/interdiff-1848940-11-15.txt deleted file mode 100644 index 37c76b0..0000000 --- a/interdiff-1848940-11-15.txt +++ /dev/null @@ -1,47 +0,0 @@ -diff --git a/core/modules/views_ui/js/views_ui.listing.js b/core/modules/views_ui/js/views_ui.listing.js -index 30d60e2..cd09979 100644 ---- a/core/modules/views_ui/js/views_ui.listing.js -+++ b/core/modules/views_ui/js/views_ui.listing.js -@@ -52,29 +52,20 @@ - }; - - //Enable button fix -- Drupal.behaviors.viewsEnableFix = { -+ Drupal.behaviors.viewsEnableFocus = { - attach: function (context, settings) { -- String.prototype.endsWith = function(str){return (this.match(str+"$")==str)}; -- -- if(window.location.href.endsWith('/admin/structure/views')==true){ -- -- $('tr.views-ui-list-disabled li.enable .use-ajax', context).on('click', function(){ -- var title=$(this).closest('tr').attr('title');// Get element title -- var interval=setInterval(function(){ // Listen for changes on upper DOM lists -- -- var trs=$('tr.views-ui-list-enabled'); -- trs.each(function(i){ -- if($(this).attr('title')==title){// If upper DOM gets updated get element(based on title) and scrool to it -- $('html, body').animate({scrollTop: Math.round($(this).offset().top)-$(this).innerHeight() },'fast'); -- $(this).find('a').focus(); -- clearInterval(interval); -- } -- }); -- -- },500); -- -- });// on click end -- }// if location end -+ $('tr.views-ui-list-disabled li.enable .use-ajax', context).on('click', function(){ -+ var title=$(this).closest('tr').attr('title');// Get element title -+ var interval=setInterval(function(){ // Listen for changes on upper DOM lists -+ var trs=$('tr.views-ui-list-enabled'); -+ trs.each(function(i){ -+ if($(this).attr('title')==title){// If upper DOM gets updated get element(based on title) and focus it -+ $(this).find('a').focus(); -+ clearInterval(interval); -+ } -+ }); -+ },500); -+ });// on click end - }// attach end - }; -