Skip to content

Commit a48a51c

Browse files
committed
Merge pull request #151 from pe4cey/keep-inspector-style-open
Keep viz style editor open
2 parents 786f067 + 4f4755e commit a48a51c

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

app/scripts/controllers/D3Graph.coffee

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,22 @@ angular.module('neo4jApp.controllers')
6868
graphView.update()
6969
selectItem(selectedItem)
7070

71+
closeContextMenuForItem = (d) =>
72+
if d is selectedItem
73+
d?.selected = no
74+
selectedItem = null
75+
else
76+
selectedItem?.selected = no
77+
d?.selected = yes
78+
selectedItem = d
79+
80+
graphView.update()
81+
selectedItem
82+
7183
$rootScope.$on 'layout.changed', (-> graphView?.resize())
7284

7385
$rootScope.$on 'close.contextMenu', (->
74-
toggleSelection(selectedItem)
86+
closeContextMenuForItem selectedItem
7587
)
7688

7789
$scope.$watch 'displayInternalRelationships', (displayInternalRelationships) ->

app/scripts/controllers/Inspector.coffee

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,16 @@ angular.module('neo4jApp.controllers')
9999
Inspector.visible = !Inspector.visible
100100

101101
$scope.selectArrowWidth = (item, size) ->
102-
$scope.$emit 'close.contextMenu'
103102
item.style = graphStyle.changeForSelector(item.style.selector, size)
104103

105104
$scope.selectCaption = (item, caption) ->
106-
$scope.$emit 'close.contextMenu'
107105
item.style = graphStyle.changeForSelector(item.style.selector, { caption: caption})
108106

109107
$scope.isSelectedCaption = (item, caption) ->
110108
grassProps = item.style.props
111109
grassProps.caption is "#{caption}" or (!grassProps.caption and caption in ["<id>", "<type>"])
112110

113111
$scope.selectScheme = (item, scheme) ->
114-
$scope.$emit 'close.contextMenu'
115112
item.style = graphStyle.changeForSelector(item.style.selector, angular.copy(scheme))
116113

117114
$scope.selectSize = (item, size) ->
@@ -127,9 +124,4 @@ angular.module('neo4jApp.controllers')
127124
width: nodeDisplaySizes[idx]
128125
height: nodeDisplaySizes[idx]
129126

130-
$scope.$watch('style', (oldValue, newValue) ->
131-
unless oldValue is newValue or newValue is not null
132-
$scope.$emit 'close.contextMenu'
133-
)
134-
135127
]

0 commit comments

Comments
 (0)