| @@ -208,32 +208,23 @@ | ||
| 208 | 208 | this.revertButton = document.getElementById('elementor-import-export__revert_kit'); |
| 209 | 209 | if (this.revertButton) { |
| 210 | 210 | this.revertButton.addEventListener('click', this.onRevertButtonClick.bind(this)); |
| 211 | 211 | this.maybeAddRevertBtnMargin(); |
| 212 | - this.maybeScrollToRevertButton(); | |
| 213 | 212 | } |
| 214 | 213 | this.maybeShowReferrerKitDialog(); |
| 215 | 214 | } |
| 215 | + | |
| 216 | + /** | |
| 217 | + * Add bottom margin to revert btn if referred from Kit library | |
| 218 | + */ | |
| 216 | 219 | return (0, _createClass2.default)(Admin, [{ |
| 217 | - key: "shouldScrollToRevert", | |
| 218 | - value: function shouldScrollToRevert() { | |
| 219 | - var urlParams = new URLSearchParams(window.location.search); | |
| 220 | - return !!urlParams.get('scroll_to_revert'); | |
| 221 | - } | |
| 222 | - }, { | |
| 223 | 220 | key: "maybeAddRevertBtnMargin", |
| 224 | 221 | value: function maybeAddRevertBtnMargin() { |
| 225 | - if (!this.shouldScrollToRevert()) { | |
| 222 | + var referrerKitId = new URLSearchParams(this.revertButton.href).get('referrer_kit'); | |
| 223 | + if (!referrerKitId) { | |
| 226 | 224 | return; |
| 227 | 225 | } |
| 228 | 226 | this.revertButton.style.marginBottom = this.calculateMargin(); |
| 229 | - } | |
| 230 | - }, { | |
| 231 | - key: "maybeScrollToRevertButton", | |
| 232 | - value: function maybeScrollToRevertButton() { | |
| 233 | - if (!this.shouldScrollToRevert()) { | |
| 234 | - return; | |
| 235 | - } | |
| 236 | 227 | this.scrollToBottom(); |
| 237 | 228 | } |
| 238 | 229 | |
| 239 | 230 | /** |