PluginProbe
Elementor Website Builder – more than just a page builder / 3.8.1
Elementor Website Builder – more than just a page builder v3.8.1
4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 All 454 releases
← All changes | assets/js/new-template.js +362 -290 4.3.0 → 3.8.1 View file →
@@ -1,303 +1,375 @@
1 -(function(_wordpress_i18n) {
1 +/*! elementor - v3.8.1 - 13-11-2022 */
2 +/******/ (() => { // webpackBootstrap
3 +/******/ var __webpack_modules__ = ({
2 4
3 -//#region \0rolldown/runtime.js
4 - var __defProp = Object.defineProperty;
5 - var __name = (target, value) => __defProp(target, "name", {
6 - value,
7 - configurable: true
8 - });
9 - var __esmMin = (fn, res, err) => () => {
10 - if (err) throw err[0];
11 - try {
12 - return fn && (res = fn(fn = 0)), res;
13 - } catch (e) {
14 - throw err = [e], e;
15 - }
16 - };
17 - var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
5 +/***/ "../assets/dev/js/admin/new-template/behaviors/lock-pro.js":
6 +/*!*****************************************************************!*\
7 + !*** ../assets/dev/js/admin/new-template/behaviors/lock-pro.js ***!
8 + \*****************************************************************/
9 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
18 10
19 -//#endregion
11 +"use strict";
20 12
21 -//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js
22 - function _classCallCheck(a, n) {
23 - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
24 - }
25 - var init_classCallCheck = __esmMin((() => {}));
26 13
27 -//#endregion
28 -//#region node_modules/@babel/runtime/helpers/esm/typeof.js
29 - function _typeof(o) {
30 - "@babel/helpers - typeof";
31 - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
32 - return typeof o;
33 - } : function(o) {
34 - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
35 - }, _typeof(o);
36 - }
37 - var init_typeof = __esmMin((() => {}));
14 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
38 15
39 -//#endregion
40 -//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js
41 - function toPrimitive(t, r) {
42 - if ("object" != _typeof(t) || !t) return t;
43 - var e = t[Symbol.toPrimitive];
44 - if (void 0 !== e) {
45 - var i = e.call(t, r || "default");
46 - if ("object" != _typeof(i)) return i;
47 - throw new TypeError("@@toPrimitive must return a primitive value.");
48 - }
49 - return ("string" === r ? String : Number)(t);
50 - }
51 - var init_toPrimitive = __esmMin((() => {
52 - init_typeof();
53 - }));
16 +Object.defineProperty(exports, "__esModule", ({
17 + value: true
18 +}));
19 +exports["default"] = void 0;
54 20
55 -//#endregion
56 -//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
57 - function toPropertyKey(t) {
58 - var i = toPrimitive(t, "string");
59 - return "symbol" == _typeof(i) ? i : i + "";
60 - }
61 - var init_toPropertyKey = __esmMin((() => {
62 - init_typeof();
63 - init_toPrimitive();
64 - }));
21 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
65 22
66 -//#endregion
67 -//#region node_modules/@babel/runtime/helpers/esm/createClass.js
68 - function _defineProperties(e, r) {
69 - for (var t = 0; t < r.length; t++) {
70 - var o = r[t];
71 - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
72 - }
73 - }
74 - function _createClass(e, r, t) {
75 - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
76 - }
77 - var init_createClass = __esmMin((() => {
78 - init_toPropertyKey();
79 - }));
23 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
80 24
81 -//#endregion
82 -//#region assets/dev/js/admin/new-template/behaviors/lock-pro.js
83 - var LockPro;
84 - var init_lock_pro = __esmMin((() => {
85 - init_classCallCheck();
86 - init_createClass();
87 - LockPro = /*#__PURE__*/ function() {
88 - function LockPro(elements) {
89 - _classCallCheck(this, LockPro);
90 - this.elements = elements;
91 - }
92 - return _createClass(LockPro, [
93 - {
94 - key: "bindEvents",
95 - value: function bindEvents() {
96 - var _this$elements = this.elements;
97 - var form = _this$elements.form;
98 - var templateType = _this$elements.templateType;
99 - form.addEventListener("submit", this.onFormSubmit.bind(this));
100 - templateType.addEventListener("change", this.onTemplateTypeChange.bind(this));
101 - this.onTemplateTypeChange();
102 - }
103 - },
104 - {
105 - key: "onFormSubmit",
106 - value: function onFormSubmit(e) {
107 - if (this.getCurrentLockOptions().is_locked) e.preventDefault();
108 - }
109 - },
110 - {
111 - key: "onTemplateTypeChange",
112 - value: function onTemplateTypeChange() {
113 - var lockOptions = this.getCurrentLockOptions();
114 - if (lockOptions.is_locked) this.lock(lockOptions);
115 - else this.unlock();
116 - }
117 - },
118 - {
119 - key: "getCurrentLockOptions",
120 - value: function getCurrentLockOptions() {
121 - var templateType = this.elements.templateType;
122 - var currentOption = templateType.options[templateType.selectedIndex];
123 - return JSON.parse(currentOption.dataset.lock || "{}");
124 - }
125 - },
126 - {
127 - key: "lock",
128 - value: function lock(lockOptions) {
129 - this.showLockBadge(lockOptions.badge);
130 - this.showLockButton(lockOptions.button);
131 - this.hideSubmitButton();
132 - }
133 - },
134 - {
135 - key: "unlock",
136 - value: function unlock() {
137 - this.hideLockBadge();
138 - this.hideLockButton();
139 - this.showSubmitButton();
140 - }
141 - },
142 - {
143 - key: "showLockBadge",
144 - value: function showLockBadge(badgeConfig) {
145 - var _this$elements2 = this.elements;
146 - var lockBadge = _this$elements2.lockBadge;
147 - var lockBadgeText = _this$elements2.lockBadgeText;
148 - var lockBadgeIcon = _this$elements2.lockBadgeIcon;
149 - lockBadgeText.innerText = badgeConfig.text;
150 - lockBadgeIcon.className = badgeConfig.icon;
151 - lockBadge.classList.remove("e-hidden");
152 - }
153 - },
154 - {
155 - key: "hideLockBadge",
156 - value: function hideLockBadge() {
157 - this.elements.lockBadge.classList.add("e-hidden");
158 - }
159 - },
160 - {
161 - key: "showLockButton",
162 - value: function showLockButton(buttonConfig) {
163 - var lockButton = this.elements.lockButton;
164 - lockButton.href = this.replaceLockLinkPlaceholders(buttonConfig.url);
165 - lockButton.innerText = buttonConfig.text;
166 - lockButton.classList.remove("e-hidden");
167 - }
168 - },
169 - {
170 - key: "hideLockButton",
171 - value: function hideLockButton() {
172 - this.elements.lockButton.classList.add("e-hidden");
173 - }
174 - },
175 - {
176 - key: "showSubmitButton",
177 - value: function showSubmitButton() {
178 - this.elements.submitButton.classList.remove("e-hidden");
179 - }
180 - },
181 - {
182 - key: "hideSubmitButton",
183 - value: function hideSubmitButton() {
184 - this.elements.submitButton.classList.add("e-hidden");
185 - }
186 - },
187 - {
188 - key: "replaceLockLinkPlaceholders",
189 - value: function replaceLockLinkPlaceholders(link) {
190 - return link.replace(/%%utm_source%%/g, "wp-add-new").replace(/%%utm_medium%%/g, "wp-dash");
191 - }
192 - }
193 - ]);
194 - }();
195 - }));
25 +var LockPro = /*#__PURE__*/function () {
26 + function LockPro(elements) {
27 + (0, _classCallCheck2.default)(this, LockPro);
28 + this.elements = elements;
29 + }
196 30
197 -//#endregion
198 -//#region assets/dev/js/admin/new-template/view.js
199 - var require_view = /* @__PURE__ */ __commonJSMin(((exports, module) => {
200 - module.exports = Marionette.ItemView.extend({
201 - id: "elementor-new-template-dialog-content",
202 - template: "#tmpl-elementor-new-template",
203 - ui: {},
204 - events: {},
205 - onRender: function onRender() {}
206 - });
207 - }));
31 + (0, _createClass2.default)(LockPro, [{
32 + key: "bindEvents",
33 + value: function bindEvents() {
34 + var _this$elements = this.elements,
35 + form = _this$elements.form,
36 + templateType = _this$elements.templateType;
37 + form.addEventListener('submit', this.onFormSubmit.bind(this));
38 + templateType.addEventListener('change', this.onTemplateTypeChange.bind(this)); // Force checking on render, to make sure that default values are also checked.
208 39
209 -//#endregion
210 -//#region assets/dev/js/admin/new-template/layout.js
211 - var require_layout = /* @__PURE__ */ __commonJSMin(((exports, module) => {
212 - init_lock_pro();
213 - var NewTemplateView = require_view();
214 - module.exports = elementorModules.common.views.modal.Layout.extend({
215 - getModalOptions: function getModalOptions() {
216 - return { id: "elementor-new-template-modal" };
217 - },
218 - getLogoOptions: function getLogoOptions() {
219 - return { title: (0, _wordpress_i18n.__)("New Template", "elementor") };
220 - },
221 - initialize: function initialize() {
222 - elementorModules.common.views.modal.Layout.prototype.initialize.apply(this, arguments);
223 - this.showLogo();
224 - this.showContentView();
225 - this.initElements();
226 - this.lockProBehavior = new LockPro(this.elements);
227 - this.lockProBehavior.bindEvents();
228 - this.setupDynamicControlsVisibility();
229 - },
230 - setupDynamicControlsVisibility: function setupDynamicControlsVisibility() {
231 - if (!("undefined" !== typeof elementor_new_template_form_controls)) return;
232 - var CONTROL_ID_PREFIX = "elementor-new-template__form__";
233 - var templateTypeSelectId = "".concat(CONTROL_ID_PREFIX, "template-type");
234 - var dynamicControlsVisibilityListener = function dynamicControlsVisibilityListener() {
235 - elementorAdmin.templateControls.setDynamicControlsVisibility(CONTROL_ID_PREFIX, elementor_new_template_form_controls);
236 - };
237 - this.getModal().onShow = function() {
238 - dynamicControlsVisibilityListener();
239 - document.getElementById(templateTypeSelectId).addEventListener("change", dynamicControlsVisibilityListener);
240 - };
241 - this.getModal().onHide = function() {
242 - document.getElementById(templateTypeSelectId).removeEventListener("change", dynamicControlsVisibilityListener);
243 - };
244 - },
245 - initElements: function initElements() {
246 - var container = this.$el[0];
247 - var root = "#elementor-new-template__form";
248 - this.elements = {
249 - form: container.querySelector(root),
250 - submitButton: container.querySelector("".concat(root, "__submit")),
251 - lockButton: container.querySelector("".concat(root, "__lock_button")),
252 - templateType: container.querySelector("".concat(root, "__template-type")),
253 - lockBadge: container.querySelector("".concat(root, "__template-type-badge")),
254 - lockBadgeText: container.querySelector("".concat(root, "__template-type-badge__text")),
255 - lockBadgeIcon: container.querySelector("".concat(root, "__template-type-badge__icon"))
256 - };
257 - },
258 - showContentView: function showContentView() {
259 - this.modalContent.show(new NewTemplateView());
260 - }
261 - });
262 - }));
40 + this.onTemplateTypeChange();
41 + }
42 + }, {
43 + key: "onFormSubmit",
44 + value: function onFormSubmit(e) {
45 + var lockOptions = this.getCurrentLockOptions();
263 46
264 -//#endregion
265 -//#region assets/dev/js/admin/new-template/new-template.js
266 - var NewTemplateLayout = require_layout();
267 - var NewTemplateModule = elementorModules.ViewModule.extend({
268 - getDefaultSettings: function getDefaultSettings() {
269 - return { selectors: { addButton: "a.page-title-action[href*=\"post-new.php?post_type=elementor_library\"], #elementor-template-library-add-new" } };
270 - },
271 - getDefaultElements: function getDefaultElements() {
272 - var selectors = this.getSettings("selectors");
273 - return { $addButton: jQuery(selectors.addButton) };
274 - },
275 - bindEvents: function bindEvents() {
276 - this.elements.$addButton.on("click", this.onAddButtonClick);
277 - elementorCommon.elements.$window.on("hashchange", this.showModalByHash.bind(this));
278 - },
279 - showModalByHash: function showModalByHash() {
280 - if ("#add_new" === location.hash) {
281 - var _this$layout;
282 - (_this$layout = this.layout) === null || _this$layout === void 0 || _this$layout.showModal();
283 - location.hash = "";
284 - }
285 - },
286 - onInit: function onInit() {
287 - elementorModules.ViewModule.prototype.onInit.apply(this, arguments);
288 - this.layout = new NewTemplateLayout();
289 - this.showModalByHash();
290 - },
291 - onAddButtonClick: function onAddButtonClick(event) {
292 - var _this$layout2;
293 - event.preventDefault();
294 - (_this$layout2 = this.layout) === null || _this$layout2 === void 0 || _this$layout2.showModal();
295 - }
296 - });
297 - jQuery(function() {
298 - window.elementorNewTemplate = new NewTemplateModule();
299 - });
47 + if (lockOptions.is_locked) {
48 + e.preventDefault();
49 + }
50 + }
51 + }, {
52 + key: "onTemplateTypeChange",
53 + value: function onTemplateTypeChange() {
54 + var lockOptions = this.getCurrentLockOptions();
300 55
301 -//#endregion
302 -})(wp.i18n);
56 + if (lockOptions.is_locked) {
57 + this.lock(lockOptions);
58 + } else {
59 + this.unlock();
60 + }
61 + }
62 + }, {
63 + key: "getCurrentLockOptions",
64 + value: function getCurrentLockOptions() {
65 + var templateType = this.elements.templateType,
66 + currentOption = templateType.options[templateType.selectedIndex];
67 + return JSON.parse(currentOption.dataset.lock || '{}');
68 + }
69 + }, {
70 + key: "lock",
71 + value: function lock(lockOptions) {
72 + this.showLockBadge(lockOptions.badge);
73 + this.showLockButton(lockOptions.button);
74 + this.hideSubmitButton();
75 + }
76 + }, {
77 + key: "unlock",
78 + value: function unlock() {
79 + this.hideLockBadge();
80 + this.hideLockButton();
81 + this.showSubmitButton();
82 + }
83 + }, {
84 + key: "showLockBadge",
85 + value: function showLockBadge(badgeConfig) {
86 + var _this$elements2 = this.elements,
87 + lockBadge = _this$elements2.lockBadge,
88 + lockBadgeText = _this$elements2.lockBadgeText,
89 + lockBadgeIcon = _this$elements2.lockBadgeIcon;
90 + lockBadgeText.innerText = badgeConfig.text;
91 + lockBadgeIcon.className = badgeConfig.icon;
92 + lockBadge.classList.remove('e-hidden');
93 + }
94 + }, {
95 + key: "hideLockBadge",
96 + value: function hideLockBadge() {
97 + this.elements.lockBadge.classList.add('e-hidden');
98 + }
99 + }, {
100 + key: "showLockButton",
101 + value: function showLockButton(buttonConfig) {
102 + var lockButton = this.elements.lockButton;
103 + lockButton.href = this.replaceLockLinkPlaceholders(buttonConfig.url);
104 + lockButton.innerText = buttonConfig.text;
105 + lockButton.classList.remove('e-hidden');
106 + }
107 + }, {
108 + key: "hideLockButton",
109 + value: function hideLockButton() {
110 + this.elements.lockButton.classList.add('e-hidden');
111 + }
112 + }, {
113 + key: "showSubmitButton",
114 + value: function showSubmitButton() {
115 + this.elements.submitButton.classList.remove('e-hidden');
116 + }
117 + }, {
118 + key: "hideSubmitButton",
119 + value: function hideSubmitButton() {
120 + this.elements.submitButton.classList.add('e-hidden');
121 + }
122 + }, {
123 + key: "replaceLockLinkPlaceholders",
124 + value: function replaceLockLinkPlaceholders(link) {
125 + return link.replace(/%%utm_source%%/g, 'wp-add-new').replace(/%%utm_medium%%/g, 'wp-dash');
126 + }
127 + }]);
128 + return LockPro;
129 +}();
130 +
131 +exports["default"] = LockPro;
132 +
133 +/***/ }),
134 +
135 +/***/ "../assets/dev/js/admin/new-template/layout.js":
136 +/*!*****************************************************!*\
137 + !*** ../assets/dev/js/admin/new-template/layout.js ***!
138 + \*****************************************************/
139 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
140 +
141 +"use strict";
142 +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
143 +
144 +
145 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
146 +
147 +var _lockPro = _interopRequireDefault(__webpack_require__(/*! ./behaviors/lock-pro */ "../assets/dev/js/admin/new-template/behaviors/lock-pro.js"));
148 +
149 +var NewTemplateView = __webpack_require__(/*! elementor-admin/new-template/view */ "../assets/dev/js/admin/new-template/view.js");
150 +
151 +module.exports = elementorModules.common.views.modal.Layout.extend({
152 + getModalOptions: function getModalOptions() {
153 + return {
154 + id: 'elementor-new-template-modal'
155 + };
156 + },
157 + getLogoOptions: function getLogoOptions() {
158 + return {
159 + title: __('New Template', 'elementor')
160 + };
161 + },
162 + initialize: function initialize() {
163 + elementorModules.common.views.modal.Layout.prototype.initialize.apply(this, arguments);
164 + var lookupControlIdPrefix = 'elementor-new-template__form__';
165 + var templateTypeSelectId = "".concat(lookupControlIdPrefix, "template-type");
166 + this.showLogo();
167 + this.showContentView();
168 + this.initElements();
169 + this.lockProBehavior = new _lockPro.default(this.elements);
170 + this.lockProBehavior.bindEvents();
171 +
172 + var dynamicControlsVisibilityListener = function dynamicControlsVisibilityListener() {
173 + elementorAdmin.templateControls.setDynamicControlsVisibility(lookupControlIdPrefix, elementor_new_template_form_controls);
174 + };
175 +
176 + this.getModal().onShow = function () {
177 + dynamicControlsVisibilityListener();
178 + document.getElementById(templateTypeSelectId).addEventListener('change', dynamicControlsVisibilityListener);
179 + };
180 +
181 + this.getModal().onHide = function () {
182 + document.getElementById(templateTypeSelectId).removeEventListener('change', dynamicControlsVisibilityListener);
183 + };
184 + },
185 + initElements: function initElements() {
186 + var container = this.$el[0],
187 + root = '#elementor-new-template__form';
188 + this.elements = {
189 + form: container.querySelector(root),
190 + submitButton: container.querySelector("".concat(root, "__submit")),
191 + lockButton: container.querySelector("".concat(root, "__lock_button")),
192 + templateType: container.querySelector("".concat(root, "__template-type")),
193 + lockBadge: container.querySelector("".concat(root, "__template-type-badge")),
194 + lockBadgeText: container.querySelector("".concat(root, "__template-type-badge__text")),
195 + lockBadgeIcon: container.querySelector("".concat(root, "__template-type-badge__icon"))
196 + };
197 + },
198 + showContentView: function showContentView() {
199 + this.modalContent.show(new NewTemplateView());
200 + }
201 +});
202 +
203 +/***/ }),
204 +
205 +/***/ "../assets/dev/js/admin/new-template/view.js":
206 +/*!***************************************************!*\
207 + !*** ../assets/dev/js/admin/new-template/view.js ***!
208 + \***************************************************/
209 +/***/ ((module) => {
210 +
211 +"use strict";
212 +
213 +
214 +module.exports = Marionette.ItemView.extend({
215 + id: 'elementor-new-template-dialog-content',
216 + template: '#tmpl-elementor-new-template',
217 + ui: {},
218 + events: {},
219 + onRender: function onRender() {}
220 +});
221 +
222 +/***/ }),
223 +
224 +/***/ "@wordpress/i18n":
225 +/*!**************************!*\
226 + !*** external "wp.i18n" ***!
227 + \**************************/
228 +/***/ ((module) => {
229 +
230 +"use strict";
231 +module.exports = wp.i18n;
232 +
233 +/***/ }),
234 +
235 +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
236 +/*!****************************************************************!*\
237 + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
238 + \****************************************************************/
239 +/***/ ((module) => {
240 +
241 +function _classCallCheck(instance, Constructor) {
242 + if (!(instance instanceof Constructor)) {
243 + throw new TypeError("Cannot call a class as a function");
244 + }
245 +}
246 +
247 +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
248 +
249 +/***/ }),
250 +
251 +/***/ "../node_modules/@babel/runtime/helpers/createClass.js":
252 +/*!*************************************************************!*\
253 + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***!
254 + \*************************************************************/
255 +/***/ ((module) => {
256 +
257 +function _defineProperties(target, props) {
258 + for (var i = 0; i < props.length; i++) {
259 + var descriptor = props[i];
260 + descriptor.enumerable = descriptor.enumerable || false;
261 + descriptor.configurable = true;
262 + if ("value" in descriptor) descriptor.writable = true;
263 + Object.defineProperty(target, descriptor.key, descriptor);
264 + }
265 +}
266 +
267 +function _createClass(Constructor, protoProps, staticProps) {
268 + if (protoProps) _defineProperties(Constructor.prototype, protoProps);
269 + if (staticProps) _defineProperties(Constructor, staticProps);
270 + Object.defineProperty(Constructor, "prototype", {
271 + writable: false
272 + });
273 + return Constructor;
274 +}
275 +
276 +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
277 +
278 +/***/ }),
279 +
280 +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
281 +/*!***********************************************************************!*\
282 + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
283 + \***********************************************************************/
284 +/***/ ((module) => {
285 +
286 +function _interopRequireDefault(obj) {
287 + return obj && obj.__esModule ? obj : {
288 + "default": obj
289 + };
290 +}
291 +
292 +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
293 +
294 +/***/ })
295 +
296 +/******/ });
297 +/************************************************************************/
298 +/******/ // The module cache
299 +/******/ var __webpack_module_cache__ = {};
300 +/******/
301 +/******/ // The require function
302 +/******/ function __webpack_require__(moduleId) {
303 +/******/ // Check if module is in cache
304 +/******/ var cachedModule = __webpack_module_cache__[moduleId];
305 +/******/ if (cachedModule !== undefined) {
306 +/******/ return cachedModule.exports;
307 +/******/ }
308 +/******/ // Create a new module (and put it into the cache)
309 +/******/ var module = __webpack_module_cache__[moduleId] = {
310 +/******/ // no module.id needed
311 +/******/ // no module.loaded needed
312 +/******/ exports: {}
313 +/******/ };
314 +/******/
315 +/******/ // Execute the module function
316 +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
317 +/******/
318 +/******/ // Return the exports of the module
319 +/******/ return module.exports;
320 +/******/ }
321 +/******/
322 +/************************************************************************/
323 +var __webpack_exports__ = {};
324 +// This entry need to be wrapped in an IIFE because it need to be in strict mode.
325 +(() => {
326 +"use strict";
327 +/*!***********************************************************!*\
328 + !*** ../assets/dev/js/admin/new-template/new-template.js ***!
329 + \***********************************************************/
330 +
331 +
332 +var NewTemplateLayout = __webpack_require__(/*! elementor-admin/new-template/layout */ "../assets/dev/js/admin/new-template/layout.js");
333 +
334 +var NewTemplateModule = elementorModules.ViewModule.extend({
335 + getDefaultSettings: function getDefaultSettings() {
336 + return {
337 + selectors: {
338 + addButton: '.page-title-action:first, #elementor-template-library-add-new'
339 + }
340 + };
341 + },
342 + getDefaultElements: function getDefaultElements() {
343 + var selectors = this.getSettings('selectors');
344 + return {
345 + $addButton: jQuery(selectors.addButton)
346 + };
347 + },
348 + bindEvents: function bindEvents() {
349 + this.elements.$addButton.on('click', this.onAddButtonClick);
350 + elementorCommon.elements.$window.on('hashchange', this.showModalByHash.bind(this));
351 + },
352 + showModalByHash: function showModalByHash() {
353 + if ('#add_new' === location.hash) {
354 + this.layout.showModal();
355 + location.hash = '';
356 + }
357 + },
358 + onInit: function onInit() {
359 + elementorModules.ViewModule.prototype.onInit.apply(this, arguments);
360 + this.layout = new NewTemplateLayout();
361 + this.showModalByHash();
362 + },
363 + onAddButtonClick: function onAddButtonClick(event) {
364 + event.preventDefault();
365 + this.layout.showModal();
366 + }
367 +});
368 +jQuery(function () {
369 + window.elementorNewTemplate = new NewTemplateModule();
370 +});
371 +})();
372 +
373 +/******/ })()
374 +;
303 375 //# sourceMappingURL=new-template.js.map