RuleChain UI improvements.

This commit is contained in:
Igor Kulikov 2018-05-16 18:11:25 +03:00
parent 9f87e4a73d
commit c5de82341f
3 changed files with 62 additions and 23 deletions

View File

@ -598,9 +598,15 @@ export function RuleChainController($state, $scope, $compile, $q, $mdUtil, $time
edgeDoubleClick: function (event, edge) { edgeDoubleClick: function (event, edge) {
openLinkDetails(edge); openLinkDetails(edge);
}, },
edgeEdit: function(event, edge) {
openLinkDetails(edge);
},
nodeCallbacks: { nodeCallbacks: {
'doubleClick': function (event, node) { 'doubleClick': function (event, node) {
openNodeDetails(node); openNodeDetails(node);
},
'nodeEdit': function (event, node) {
openNodeDetails(node);
} }
}, },
isValidEdge: function (source, destination) { isValidEdge: function (source, destination) {

View File

@ -223,6 +223,7 @@
.fc-node { .fc-node {
z-index: 1; z-index: 1;
outline: none; outline: none;
border-radius: 8px;
&.fc-dragging { &.fc-dragging {
z-index: 10; z-index: 10;
} }
@ -239,6 +240,7 @@
bottom: 0; bottom: 0;
background-color: #000; background-color: #000;
opacity: 0; opacity: 0;
border-radius: 5px;
} }
&.fc-hover { &.fc-hover {
.fc-node-overlay { .fc-node-overlay {
@ -250,6 +252,12 @@
opacity: 0.25; opacity: 0.25;
} }
} }
&.fc-selected {
&:not(.fc-edit) {
border: solid 3px red;
margin: -3px;
}
}
} }
.fc-leftConnectors, .fc-rightConnectors { .fc-leftConnectors, .fc-rightConnectors {
@ -340,27 +348,43 @@
.fc-nodedelete { .fc-nodedelete {
display: none; display: none;
font-size: 18px;
} }
.fc-selected .fc-nodedelete { .fc-nodeedit {
display: none;
font-size: 15px;
}
.fc-edit {
.fc-nodedelete, .fc-nodeedit {
outline: none; outline: none;
display: block; display: block;
position: absolute; position: absolute;
right: -13px;
top: -16px;
border: solid 2px white; border: solid 2px white;
border-radius: 50%; border-radius: 50%;
font-weight: 600; font-weight: 600;
font-size: 18px; line-height: 20px;
line-height: 18px;
height: 20px; height: 20px;
padding-top: 2px; padding-top: 2px;
width: 22px; width: 22px;
background: #494949; background: #f83e05;
color: #fff; color: #fff;
text-align: center; text-align: center;
vertical-align: bottom; vertical-align: bottom;
cursor: pointer; cursor: pointer;
}
.fc-nodeedit {
top: -24px;
right: 16px;
}
.fc-nodedelete {
top: -24px;
right: -13px;
}
} }
.fc-noselect { .fc-noselect {
@ -376,7 +400,7 @@
.fc-edge-label { .fc-edge-label {
position: absolute; position: absolute;
transition: transform .2s; transition: transform .2s;
opacity: 0.8; // opacity: 0.8;
&.ng-leave { &.ng-leave {
transition: 0s none; transition: 0s none;
} }
@ -387,13 +411,19 @@
.fc-edge-label-text { .fc-edge-label-text {
span { span {
border: solid red; border: solid red;
color: red; color: #fff;
font-weight: 600;
background-color: red;
} }
} }
} }
.fc-nodeedit {
top: -30px;
right: 14px;
}
.fc-nodedelete { .fc-nodedelete {
right: -13px;
top: -30px; top: -30px;
right: -13px;
} }
&:focus { &:focus {
outline: 0; outline: 0;

View File

@ -45,6 +45,9 @@
</div> </div>
</div> </div>
</div> </div>
<div ng-if="modelservice.isEditable() && !node.readonly" class="fc-nodeedit" ng-click="callbacks.nodeEdit($event, node)">
<i class="fa fa-pencil" aria-hidden="true"></i>
</div>
<div ng-if="modelservice.isEditable() && !node.readonly" class="fc-nodedelete" ng-click="modelservice.nodes.delete(node)"> <div ng-if="modelservice.isEditable() && !node.readonly" class="fc-nodedelete" ng-click="modelservice.nodes.delete(node)">
&times; &times;
</div> </div>