Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CSS to ensure there is a drop target for empty group #1270

Merged
merged 3 commits into from
Sep 11, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion nodes/config/ui_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,26 @@
display: flex;
flex-direction: column;
}
div.nrdb2-sb-widget-list-container ol.nrdb2-sb-widget-list.red-ui-editableList-list.ui-sortable {
min-height: 20px; /* IMPORTANT! So that user when last element is dragged out it doesnt collapse. */
}
div.nrdb2-sb-widget-list-container ol.nrdb2-sb-widget-list.red-ui-editableList-list.ui-sortable:empty {
border: 1px dashed #c4c4c4;
padding: 7px; /* should be 9px to match the other entries but border width is 2px */
joepavitt marked this conversation as resolved.
Show resolved Hide resolved
height: 20px; /* To make it visible */
text-align: center;
border-left-width: 0;
border-right-width: 0;
background-color: #f9f9f9;
}
div.nrdb2-sb-widget-list-container ol.nrdb2-sb-widget-list.red-ui-editableList-list.ui-sortable:empty::before {
content: "empty";
color: #d2d2d2;
font-style: italic;
}
ol.nrdb2-sb-group-list li:last-child ol.nrdb2-sb-widget-list.red-ui-editableList-list.ui-sortable:empty {
border-bottom-width: 0px;
}
</style>


Expand Down Expand Up @@ -1043,7 +1063,7 @@
addItem: function (container, i, /** @type {DashboardItem} */ widget) {
const titleRow = $('<div>', { class: 'nrdb2-sb-list-header nrdb2-sb-widgets-list-header' }).appendTo(container)
$('<i class="nrdb2-sb-list-handle nrdb2-sb-widget-list-handle fa fa-bars"></i>').appendTo(titleRow)

// Set the icon
const ico = $('<i>', { class: 'nrdb2-sb-icon nrdb2-sb-widget-icon' }).appendTo(titleRow)
let widgetIcon = RED.utils.getNodeIcon(widget.node?._def, widget.node) || 'fa-question'
Expand Down
Loading