From c00c74704c2723a45cf5106f6d8ef45e148903fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauro=20Ferr=C3=A3o?= Date: Wed, 11 Oct 2023 11:31:19 +0100 Subject: [PATCH] Remove position tab for drawer widget (#2148) * Remove position tab for drawer widget relates to xibosignageltd/xibo-private#516 * Drop to layout fix relates to xibosignageltd/xibo-private#516 --- ui/src/editor-core/properties-panel.js | 6 +++++- ui/src/layout-editor/main.js | 21 ++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ui/src/editor-core/properties-panel.js b/ui/src/editor-core/properties-panel.js index dab5e524f4..4d8e9e1b20 100644 --- a/ui/src/editor-core/properties-panel.js +++ b/ui/src/editor-core/properties-panel.js @@ -990,7 +990,11 @@ PropertiesPanel.prototype.render = function( if ( app.mainObjectType === 'layout' && ( - target.type === 'widget' || + ( + target.type === 'widget' && + // Don't show for drawer widget + target.drawerWidget != true + ) || target.subType === 'playlist' || isElementGroup ) diff --git a/ui/src/layout-editor/main.js b/ui/src/layout-editor/main.js index 91b544736f..bc05f60ca7 100644 --- a/ui/src/layout-editor/main.js +++ b/ui/src/layout-editor/main.js @@ -397,29 +397,32 @@ lD.selectObject = if (!$.isEmptyObject(this.toolbar.selectedCard)) { // Get card object const card = this.toolbar.selectedCard[0]; - // Check if droppable is active - const activeDroppable = (target) ? - target.hasClass('ui-droppable-active') : - true; // Drop to target validations const dropToPlaylist = ( + target && target.data('subType') == 'playlist' && lD.common.hasTarget(card, 'playlist') ); - const dropToDrawerOrZone = - ['drawer', 'zone'].includes(target.data('subType')); + const dropToDrawerOrZone = ( + target && + ['drawer', 'zone'].includes(target.data('subType')) + ); const dropToWidget = ( + target && target.hasClass('designer-widget') && - activeDroppable + target.hasClass('ui-droppable-active') ); - const dropToActionTarget = - target.hasClass('ui-droppable-actions-target'); + const dropToActionTarget = ( + target && + target.hasClass('ui-droppable-actions-target') + ); const dropToElementAndElGroup = ( + target && ( target.hasClass('designer-element-group') || target.hasClass('designer-element')