From a9416a71730e52112ab025a83f129181e3ab0898 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Thu, 14 Mar 2019 12:26:54 -0300 Subject: [PATCH] Fixed multiple modals after click in "Release x.x.x information" Closes woocommerce/woocommerce-beta-tester#47 --- .../assets/js/version-information.js | 5 ++++ .../assets/js/version-information.min.js | 2 +- .../assets/js/version-picker.min.js | 2 +- .../woocommerce-beta-tester/package-lock.json | 26 ++++++------------- 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/plugins/woocommerce-beta-tester/assets/js/version-information.js b/plugins/woocommerce-beta-tester/assets/js/version-information.js index e434a12dac5..9528bf18a63 100644 --- a/plugins/woocommerce-beta-tester/assets/js/version-information.js +++ b/plugins/woocommerce-beta-tester/assets/js/version-information.js @@ -25,6 +25,11 @@ jQuery(function( $ ) { showModal: function( event ) { event.preventDefault(); + // Prevent multiple modals. + if ( 0 < $( '.wc-backbone-modal-beta-tester-version-info' ).length ) { + return; + } + $( this ).WCBackboneModal({ template: 'wc-beta-tester-version-info', variable: { diff --git a/plugins/woocommerce-beta-tester/assets/js/version-information.min.js b/plugins/woocommerce-beta-tester/assets/js/version-information.min.js index af749f269f4..ddfe3d41f10 100644 --- a/plugins/woocommerce-beta-tester/assets/js/version-information.min.js +++ b/plugins/woocommerce-beta-tester/assets/js/version-information.min.js @@ -1 +1 @@ -jQuery(function(e){({init:function(){e("#wp-admin-bar-show-version-info").on("click",this.showModal)},showModal:function(i){i.preventDefault(),e(this).WCBackboneModal({template:"wc-beta-tester-version-info",variable:{version:wc_beta_tester_version_info_params.version,description:wc_beta_tester_version_info_params.description}})}}).init()}); +jQuery(function(i){({init:function(){i("#wp-admin-bar-show-version-info").on("click",this.showModal)},showModal:function(e){e.preventDefault(),0