PluginProbe
Elementor Website Builder – more than just a page builder / 3.19.2
Elementor Website Builder – more than just a page builder v3.19.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 4.1.0-dev2 4.0.8 All 454 releases
← All changes | assets/js/gutenberg.js +20 -44 4.2.0-beta2 → 3.19.2 View file →
@@ -1,4 +1,5 @@
1 +/*! elementor - v3.19.0 - 07-02-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,29 +74,35 @@
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 - var editorButtonParent = self.cache.$gutenberg.find('.block-editor-writing-flow');
81 - if (!editorButtonParent.length) {
82 - editorButtonParent = self.cache.$gutenberg.find('.is-desktop-preview');
83 - }
84 - self.cache.$gurenbergBlockList = editorButtonParent;
82 + self.cache.$gurenbergBlockList = self.cache.$gutenberg.find('.is-desktop-preview');
85 83 self.cache.$gurenbergBlockList.append(self.cache.$editorPanel);
86 84 self.cache.$editorPanelButton = self.cache.$editorPanel.find('#elementor-go-to-edit-page-link');
87 85 self.cache.$editorPanelButton.on('click', function (event) {
88 86 event.preventDefault();
89 - self.handleEditButtonClick();
87 + self.animateLoader();
88 +
89 + // A new post is initialized as an 'auto-draft'.
90 + // if the post is not a new post it should not save it to avoid some saving conflict between elementor and gutenberg.
91 + var isNewPost = 'auto-draft' === wp.data.select('core/editor').getCurrentPost().status;
92 + if (isNewPost) {
93 + var documentTitle = wp.data.select('core/editor').getEditedPostAttribute('title');
94 + if (!documentTitle) {
95 + wp.data.dispatch('core/editor').editPost({
96 + title: 'Elementor #' + $('#post_ID').val()
97 + });
98 + }
99 + wp.data.dispatch('core/editor').savePost();
100 + }
101 + self.redirectWhenSave();
90 102 });
91 103 }
92 104 },
93 - handleIframe: function handleIframe() {
94 - this.hideIframeContent();
95 - this.buildPanelTopBar();
96 - },
97 105 // Sometimes Gutenberg uses iframe instead of div.
98 106 hasIframe: function hasIframe() {
99 107 return !!this.cache.$gutenberg.find('iframe[name="editor-canvas"]').length;
100 108 },
@@ -103,40 +111,8 @@
103 111 return;
104 112 }
105 113 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 114 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 115 },
140 116 bindEvents: function bindEvents() {
141 117 var self = this;
142 118 self.cache.$switchModeButton.on('click', function () {