Skip to content

Commit

Permalink
Simplify and improve group node
Browse files Browse the repository at this point in the history
  • Loading branch information
StefansArya committed Jan 11, 2024
1 parent 9ce083f commit 0245d4b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
6 changes: 6 additions & 0 deletions nodes/Decoration/Group/Default.panel.sf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<bppc-decoration-group-default>
<div class="field title">
<span class="name">Title:</span>
<span class="help" title="Panel below is derived from Decoration/Group/Default.panel.sf"><i class="fas fa-question-circle"></i></span>
<textarea sf-bind="title" placeholder="Add title here..."></textarea>
</div>
<div class="field textContent">
Expand Down Expand Up @@ -43,6 +44,11 @@ bppc-decoration-group-default {
width: 98%;
}

.help{
float: right;
margin-right: 2px;
}

.title textarea:focus {
box-shadow: 0 0 8px 1px white;
}
Expand Down
22 changes: 7 additions & 15 deletions nodes/Decoration/Group/Default.sf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
height: {{ data.height }}px;
width: {{ data.width }}px;
{{ data.color ? ('background: ' + data.color + '6e;') : '' }}
{{ data.fontColor ? ('color: ' + data.fontColor + ';') : '' }}
color: {{ data.fontColor ? data.fontColor : 'black' }};
">
<div class="header"
style="{{ data.color ? ('background: ' + data.color + '6e;') : '' }}"
Expand Down Expand Up @@ -47,15 +47,16 @@ sf-space[blackprint] .nodes bpic-decoration-group-default .node {
overflow: hidden;
max-width: 100%;
max-height: 100%;
color: black;
}
.header{
background: #b8b8ff91;
font-weight: bold;
font-size: 14px;
pointer-events: all;
white-space: pre-line;
color: black;
}
.other{
color: white;
}

.sides {
Expand Down Expand Up @@ -205,7 +206,7 @@ class extends Blackprint.Interface{

for (var i = 0, n = cableList.length; i < n; i++) {
let temp = cableList[i];
if(temp.hasBranch === false) continue;
if(!(temp.hasBranch !== false || !temp.connected)) continue;

let [x, y] = temp.head2;
if(x >= sx && x <= ex
Expand Down Expand Up @@ -283,17 +284,8 @@ class extends Blackprint.Interface{

// Clear any selections
let container = this.$space('container');
let nodes = container.nodeScope.selected;
let cables = container.nodeScope.selected;

for(let i = 0; i < nodes.length; i++)
nodes[i]._nodeSelected = false;

for(let i = 0; i < cables.length; i++)
cables[i]._nodeSelected = false;

nodes.splice(0);
cables.splice(0);
container.nodeScope.deselectAll();
container.cableScope.deselectAll();
}

destroy(){
Expand Down

0 comments on commit 0245d4b

Please sign in to comment.