Skip to content

Commit

Permalink
first round
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevoss committed Nov 20, 2024
1 parent 24a6d66 commit 606817c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion assets/dev/js/editor/elements/views/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ BaseElementView = BaseContainer.extend( {
return;
}

this.$el.html5Draggable( {
this.$el.children(':first-child').html5Draggable( {
onDragStart: ( e ) => {
e.stopPropagation();

Expand Down
25 changes: 17 additions & 8 deletions assets/dev/js/editor/elements/views/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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
} );
Expand Down Expand Up @@ -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;
4 changes: 4 additions & 0 deletions modules/atomic-widgets/base/atomic-widget-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ private function sanitize_atomic_settings( array $settings ): array {
return $validated;
}

public function before_render() {}

public function after_render() {}

/**
* @return array<string, Prop_Type>
*/
Expand Down

0 comments on commit 606817c

Please sign in to comment.