From 81fd117b7067513874e48669e2467ce9025110e6 Mon Sep 17 00:00:00 2001 From: Sabbir Ahmed Date: Mon, 7 Jun 2021 22:43:33 +0600 Subject: [PATCH] redirect without removing the events handler --- assets/js/admin/wc-shipping-zones.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/js/admin/wc-shipping-zones.js b/assets/js/admin/wc-shipping-zones.js index 4917643cd87..be7120fbc4c 100644 --- a/assets/js/admin/wc-shipping-zones.js +++ b/assets/js/admin/wc-shipping-zones.js @@ -79,6 +79,11 @@ $tbody.on( 'change', { view: this }, this.updateModelOnChange ); $tbody.on( 'sortupdate', { view: this }, this.updateModelOnSort ); $( window ).on( 'beforeunload', { view: this }, this.unloadConfirmation ); + $( document.body ).on( 'click', '.wc-shipping-zone-add', { view: this }, this.onAddNewRow ); + }, + onAddNewRow: function() { + var $link = $( this ); + window.location.href = $link.attr( 'href' ); }, block: function() { $( this.el ).block({