PluginProbe
Elementor Website Builder – more than just a page builder / 3.21.0-beta2
Elementor Website Builder – more than just a page builder v3.21.0-beta2
4.3.3 4.3.2 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 All 456 releases
← All changes | assets/js/gutenberg.js +19 -39 4.1.0-dev3 → 3.21.0-beta2 View file →
@@ -1,4 +1,5 @@
1 +/*! elementor - v3.21.0 - 08-04-2024 */
1 2 /******/ (() => { // webpackBootstrap
2 3 /******/ "use strict";
3 4 /******/ var __webpack_modules__ = ({
4 5
@@ -38,9 +39,10 @@
38 39 /******/ return module.exports;
39 40 /******/ }
40 41 /******/
41 42 /************************************************************************/
42 -// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
43 +var __webpack_exports__ = {};
44 +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
43 45 (() => {
44 46 /*!*******************************************!*\
45 47 !*** ../assets/dev/js/admin/gutenberg.js ***!
46 48 \*******************************************/
@@ -72,9 +74,9 @@
72 74 if (!self.cache.$gutenberg.find('#elementor-switch-mode').length) {
73 75 self.cache.$gutenberg.find('.edit-post-header-toolbar').append(self.cache.$switchMode);
74 76 }
75 77 if (this.hasIframe()) {
76 - this.handleIframe();
78 + this.hideIframeContent();
77 79 }
78 80 if (!$('#elementor-editor').length) {
79 81 self.cache.$editorPanel = $($('#elementor-gutenberg-panel').html());
80 82 var editorButtonParent = self.cache.$gutenberg.find('.block-editor-writing-flow');
@@ -85,16 +87,26 @@
85 87 self.cache.$gurenbergBlockList.append(self.cache.$editorPanel);
86 88 self.cache.$editorPanelButton = self.cache.$editorPanel.find('#elementor-go-to-edit-page-link');
87 89 self.cache.$editorPanelButton.on('click', function (event) {
88 90 event.preventDefault();
89 - self.handleEditButtonClick();
91 + self.animateLoader();
92 +
93 + // A new post is initialized as an 'auto-draft'.
94 + // if the post is not a new post it should not save it to avoid some saving conflict between elementor and gutenberg.
95 + var isNewPost = 'auto-draft' === wp.data.select('core/editor').getCurrentPost().status;
96 + if (isNewPost) {
97 + var documentTitle = wp.data.select('core/editor').getEditedPostAttribute('title');
98 + if (!documentTitle) {
99 + wp.data.dispatch('core/editor').editPost({
100 + title: 'Elementor #' + $('#post_ID').val()
101 + });
102 + }
103 + wp.data.dispatch('core/editor').savePost();
104 + }
105 + self.redirectWhenSave();
90 106 });
91 107 }
92 108 },
93 - handleIframe: function handleIframe() {
94 - this.hideIframeContent();
95 - this.buildPanelTopBar();
96 - },
97 109 // Sometimes Gutenberg uses iframe instead of div.
98 110 hasIframe: function hasIframe() {
99 111 return !!this.cache.$gutenberg.find('iframe[name="editor-canvas"]').length;
100 112 },
@@ -103,40 +115,8 @@
103 115 return;
104 116 }
105 117 var style = "<style>\n\t\t\t\t.editor-post-text-editor,\n\t\t\t\t.block-editor-block-list__layout {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\n\t\t\t\tbody {\n\t\t\t\t\tpadding: 0 !important;\n\t\t\t\t}\n\t\t\t</style>";
106 118 this.cache.$gutenberg.find('iframe[name="editor-canvas"]').contents().find('body').append(style);
107 - },
108 - buildPanelTopBar: function buildPanelTopBar() {
109 - var self = this;
110 - if (!$('#elementor-edit-mode-button').length && this.isElementorMode) {
111 - self.cache.$editorBtnTop = $($('#elementor-gutenberg-button-tmpl').html());
112 - self.cache.$gutenberg.find('.edit-post-header-toolbar').append(self.cache.$editorBtnTop);
113 - $('#elementor-edit-mode-button').on('click', function (event) {
114 - event.preventDefault();
115 - self.handleEditButtonClick(false);
116 - });
117 - }
118 - },
119 - handleEditButtonClick: function handleEditButtonClick() {
120 - var withAnimation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
121 - var self = this;
122 - if (withAnimation) {
123 - self.animateLoader();
124 - }
125 -
126 - // A new post is initialized as an 'auto-draft'.
127 - // if the post is not a new post it should not save it to avoid some saving conflict between elementor and gutenberg.
128 - var isNewPost = 'auto-draft' === wp.data.select('core/editor').getCurrentPost().status;
129 - if (isNewPost) {
130 - var documentTitle = wp.data.select('core/editor').getEditedPostAttribute('title');
131 - if (!documentTitle) {
132 - wp.data.dispatch('core/editor').editPost({
133 - title: 'Elementor #' + $('#post_ID').val()
134 - });
135 - }
136 - wp.data.dispatch('core/editor').savePost();
137 - }
138 - self.redirectWhenSave();
139 119 },
140 120 bindEvents: function bindEvents() {
141 121 var self = this;
142 122 self.cache.$switchModeButton.on('click', function () {