From fc51a83ed81bc57fd547db442ae3c2287793dee6 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Tue, 16 Jan 2018 17:15:32 +0000 Subject: [PATCH] Plugins: Fix the plugin details modal "Close" button after [42443]. Props rinkuyadav999. Fixes #43082. Built from https://develop.svn.wordpress.org/trunk@42491 git-svn-id: http://core.svn.wordpress.org/trunk@42320 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/plugin-install.js | 6 ++++-- wp-admin/js/plugin-install.min.js | 2 +- wp-includes/version.php | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-admin/js/plugin-install.js b/wp-admin/js/plugin-install.js index 8404b5260a..f2a0965a53 100644 --- a/wp-admin/js/plugin-install.js +++ b/wp-admin/js/plugin-install.js @@ -148,9 +148,11 @@ jQuery( document ).ready( function( $ ) { /* * Open the Plugin details modal. The event is delegated to get also the links - * in the plugins search tab, after the AJAX search rebuilds the HTML. + * in the plugins search tab, after the AJAX search rebuilds the HTML. It's + * delegated on the closest ancestor and not on the body to avoid conflicts + * with other handlers, see Trac ticket #43082. */ - $( 'body' ).on( 'click', '.thickbox.open-plugin-details-modal', function( e ) { + $( '.wrap' ).on( 'click', '.thickbox.open-plugin-details-modal', function( e ) { // The `data-title` attribute is used only in the Plugin screens. var title = $( this ).data( 'title' ) ? plugininstallL10n.plugin_information + ' ' + $( this ).data( 'title' ) : plugininstallL10n.plugin_modal_label; diff --git a/wp-admin/js/plugin-install.min.js b/wp-admin/js/plugin-install.min.js index 4944dded4c..6ea5fb4c6f 100644 --- a/wp-admin/js/plugin-install.min.js +++ b/wp-admin/js/plugin-install.min.js @@ -1 +1 @@ -var tb_position;jQuery(document).ready(function(a){function b(){var b=e.find("#TB_iframeContent");f=b.contents().find("body"),c(),h.focus(),a("#plugin-information-tabs a",f).on("click",function(){c()}),f.on("keydown",function(a){27===a.which&&tb_remove()})}function c(){var b;g=a(":tabbable",f),h=e.find("#TB_closeWindowButton"),i=g.last(),b=h.add(i),b.off("keydown.wp-plugin-details"),b.on("keydown.wp-plugin-details",function(a){d(a)})}function d(a){9===a.which&&(i[0]!==a.target||a.shiftKey?h[0]===a.target&&a.shiftKey&&(a.preventDefault(),i.focus()):(a.preventDefault(),h.focus()))}var e,f,g,h,i,j=a(),k=a(".upload-view-toggle"),l=a(".wrap"),m=a(document.body);tb_position=function(){var b=a(window).width(),c=a(window).height()-(792