From 606817c35801eed7eee4d54941d9888b156ea6e2 Mon Sep 17 00:00:00 2001 From: Nevo Golan <20494189+Nevoss@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:01:00 +0200 Subject: [PATCH] first round --- assets/dev/js/editor/elements/views/base.js | 2 +- assets/dev/js/editor/elements/views/widget.js | 25 +++++++++++++------ .../base/atomic-widget-base.php | 4 +++ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/assets/dev/js/editor/elements/views/base.js b/assets/dev/js/editor/elements/views/base.js index 2c7b056624b..e2a14ee21c6 100644 --- a/assets/dev/js/editor/elements/views/base.js +++ b/assets/dev/js/editor/elements/views/base.js @@ -1059,7 +1059,7 @@ BaseElementView = BaseContainer.extend( { return; } - this.$el.html5Draggable( { + this.$el.children(':first-child').html5Draggable( { onDragStart: ( e ) => { e.stopPropagation(); diff --git a/assets/dev/js/editor/elements/views/widget.js b/assets/dev/js/editor/elements/views/widget.js index d33dc3edea7..35bf4920d86 100644 --- a/assets/dev/js/editor/elements/views/widget.js +++ b/assets/dev/js/editor/elements/views/widget.js @@ -21,16 +21,16 @@ const WidgetView = BaseWidget.extend( { var behaviors = BaseWidget.prototype.behaviors.apply( this, arguments ); _.extend( behaviors, { - InlineEditing: { - behaviorClass: require( 'elementor-behaviors/inline-editing' ), - inlineEditingClass: 'elementor-inline-editing', - }, + // InlineEditing: { + // behaviorClass: require( 'elementor-behaviors/inline-editing' ), + // inlineEditingClass: 'elementor-inline-editing', + // }, Draggable: { behaviorClass: WidgetDraggable, }, - Resizable: { - behaviorClass: WidgetResizable, - }, + // Resizable: { + // behaviorClass: WidgetResizable, + // }, } ); return elementor.hooks.applyFilters( 'elements/widget/behaviors', behaviors, this ); @@ -98,7 +98,7 @@ const WidgetView = BaseWidget.extend( { attachElContent( html ) { _.defer( () => { - elementorFrontend.elements.window.jQuery( this.el ).empty().append( this.getHandlesOverlay(), this.getHTMLContent( html ) ); + elementorFrontend.elements.window.jQuery( this.el ).empty().append( this.getHTMLContent( html ) ); this.bindUIElements(); // Build again the UI elements since the content attached just now } ); @@ -146,6 +146,15 @@ const WidgetView = BaseWidget.extend( { this.onEditButtonClick( event ); } }, + + attributes() { + const attrs = BaseWidget.prototype.attributes.apply( this, arguments ); + + return { + ...attrs, + style: 'display: contents !important;', + }; + }, } ); module.exports = WidgetView; diff --git a/modules/atomic-widgets/base/atomic-widget-base.php b/modules/atomic-widgets/base/atomic-widget-base.php index 4e1afd9749b..9310fae7047 100644 --- a/modules/atomic-widgets/base/atomic-widget-base.php +++ b/modules/atomic-widgets/base/atomic-widget-base.php @@ -169,6 +169,10 @@ private function sanitize_atomic_settings( array $settings ): array { return $validated; } + public function before_render() {} + + public function after_render() {} + /** * @return array */