| @@ -1,4 +1,5 @@ | ||
| 1 | +/*! elementor - v3.28.0 - 10-03-2025 */ | |
| 1 | 2 | /******/ (() => { // webpackBootstrap |
| 2 | 3 | /******/ var __webpack_modules__ = ({ |
| 3 | 4 | |
| 4 | 5 | /***/ "../assets/dev/js/admin/new-template/behaviors/lock-pro.js": |
| @@ -147,26 +148,17 @@ | ||
| 147 | 148 | }; |
| 148 | 149 | }, |
| 149 | 150 | initialize: function initialize() { |
| 150 | 151 | elementorModules.common.views.modal.Layout.prototype.initialize.apply(this, arguments); |
| 152 | + var lookupControlIdPrefix = 'elementor-new-template__form__'; | |
| 153 | + var templateTypeSelectId = "".concat(lookupControlIdPrefix, "template-type"); | |
| 151 | 154 | this.showLogo(); |
| 152 | 155 | this.showContentView(); |
| 153 | 156 | this.initElements(); |
| 154 | 157 | this.lockProBehavior = new _lockPro.default(this.elements); |
| 155 | 158 | this.lockProBehavior.bindEvents(); |
| 156 | - this.setupDynamicControlsVisibility(); | |
| 157 | - }, | |
| 158 | - setupDynamicControlsVisibility: function setupDynamicControlsVisibility() { | |
| 159 | - // eslint-disable-next-line camelcase | |
| 160 | - var isFormControlsDefined = 'undefined' !== typeof elementor_new_template_form_controls; | |
| 161 | - if (!isFormControlsDefined) { | |
| 162 | - return; | |
| 163 | - } | |
| 164 | - var CONTROL_ID_PREFIX = 'elementor-new-template__form__'; | |
| 165 | - var templateTypeSelectId = "".concat(CONTROL_ID_PREFIX, "template-type"); | |
| 166 | 159 | var dynamicControlsVisibilityListener = function dynamicControlsVisibilityListener() { |
| 167 | - // eslint-disable-next-line camelcase | |
| 168 | - elementorAdmin.templateControls.setDynamicControlsVisibility(CONTROL_ID_PREFIX, elementor_new_template_form_controls); | |
| 160 | + elementorAdmin.templateControls.setDynamicControlsVisibility(lookupControlIdPrefix, elementor_new_template_form_controls); | |
| 169 | 161 | }; |
| 170 | 162 | this.getModal().onShow = function () { |
| 171 | 163 | dynamicControlsVisibilityListener(); |
| 172 | 164 | document.getElementById(templateTypeSelectId).addEventListener('change', dynamicControlsVisibilityListener); |
| @@ -213,8 +205,19 @@ | ||
| 213 | 205 | }); |
| 214 | 206 | |
| 215 | 207 | /***/ }), |
| 216 | 208 | |
| 209 | +/***/ "@wordpress/i18n": | |
| 210 | +/*!**************************!*\ | |
| 211 | + !*** external "wp.i18n" ***! | |
| 212 | + \**************************/ | |
| 213 | +/***/ ((module) => { | |
| 214 | + | |
| 215 | +"use strict"; | |
| 216 | +module.exports = wp.i18n; | |
| 217 | + | |
| 218 | +/***/ }), | |
| 219 | + | |
| 217 | 220 | /***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js": |
| 218 | 221 | /*!****************************************************************!*\ |
| 219 | 222 | !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! |
| 220 | 223 | \****************************************************************/ |
| @@ -317,19 +320,8 @@ | ||
| 317 | 320 | }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); |
| 318 | 321 | } |
| 319 | 322 | module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 320 | 323 | |
| 321 | -/***/ }), | |
| 322 | - | |
| 323 | -/***/ "@wordpress/i18n": | |
| 324 | -/*!**************************!*\ | |
| 325 | - !*** external "wp.i18n" ***! | |
| 326 | - \**************************/ | |
| 327 | -/***/ ((module) => { | |
| 328 | - | |
| 329 | -"use strict"; | |
| 330 | -module.exports = wp.i18n; | |
| 331 | - | |
| 332 | 324 | /***/ }) |
| 333 | 325 | |
| 334 | 326 | /******/ }); |
| 335 | 327 | /************************************************************************/ |
| @@ -371,9 +363,9 @@ | ||
| 371 | 363 | var NewTemplateModule = elementorModules.ViewModule.extend({ |
| 372 | 364 | getDefaultSettings: function getDefaultSettings() { |
| 373 | 365 | return { |
| 374 | 366 | selectors: { |
| 375 | - addButton: 'a.page-title-action[href*="post-new.php?post_type=elementor_library"], #elementor-template-library-add-new' | |
| 367 | + addButton: '.page-title-action:first, #elementor-template-library-add-new' | |
| 376 | 368 | } |
| 377 | 369 | }; |
| 378 | 370 | }, |
| 379 | 371 | getDefaultElements: function getDefaultElements() { |
| @@ -387,10 +379,9 @@ | ||
| 387 | 379 | elementorCommon.elements.$window.on('hashchange', this.showModalByHash.bind(this)); |
| 388 | 380 | }, |
| 389 | 381 | showModalByHash: function showModalByHash() { |
| 390 | 382 | if ('#add_new' === location.hash) { |
| 391 | - var _this$layout; | |
| 392 | - (_this$layout = this.layout) === null || _this$layout === void 0 || _this$layout.showModal(); | |
| 383 | + this.layout.showModal(); | |
| 393 | 384 | location.hash = ''; |
| 394 | 385 | } |
| 395 | 386 | }, |
| 396 | 387 | onInit: function onInit() { |
| @@ -398,11 +389,10 @@ | ||
| 398 | 389 | this.layout = new NewTemplateLayout(); |
| 399 | 390 | this.showModalByHash(); |
| 400 | 391 | }, |
| 401 | 392 | onAddButtonClick: function onAddButtonClick(event) { |
| 402 | - var _this$layout2; | |
| 403 | 393 | event.preventDefault(); |
| 404 | - (_this$layout2 = this.layout) === null || _this$layout2 === void 0 || _this$layout2.showModal(); | |
| 394 | + this.layout.showModal(); | |
| 405 | 395 | } |
| 406 | 396 | }); |
| 407 | 397 | jQuery(function () { |
| 408 | 398 | window.elementorNewTemplate = new NewTemplateModule(); |