File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -167,8 +167,8 @@ mind.bus.addListener('selectNodes', nodes => {
167167mind . bus . addListener ( 'unselectNodes' , nodes => {
168168 console . log ( 'unselectNodes' , nodes )
169169} )
170- mind . bus . addListener ( 'expandNode ' , node => {
171- console . log ( 'expandNode : ' , node )
170+ mind . bus . addListener ( 'changeDirection ' , direction => {
171+ console . log ( 'changeDirection : ' , direction )
172172} )
173173
174174const dl2 = async ( ) => {
Original file line number Diff line number Diff line change @@ -271,6 +271,7 @@ export const initLeft = function (this: MindElixirInstance) {
271271 this . direction = 0
272272 this . refresh ( )
273273 this . toCenter ( )
274+ this . bus . fire ( 'changeDirection' , this . direction )
274275}
275276/**
276277 * @function
@@ -283,6 +284,7 @@ export const initRight = function (this: MindElixirInstance) {
283284 this . direction = 1
284285 this . refresh ( )
285286 this . toCenter ( )
287+ this . bus . fire ( 'changeDirection' , this . direction )
286288}
287289/**
288290 * @function
@@ -295,6 +297,7 @@ export const initSide = function (this: MindElixirInstance) {
295297 this . direction = 2
296298 this . refresh ( )
297299 this . toCenter ( )
300+ this . bus . fire ( 'changeDirection' , this . direction )
298301}
299302
300303/**
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ export type EventMap = {
7575 selectNodes : ( nodeObj : NodeObj [ ] ) => void
7676 unselectNodes : ( nodeObj : NodeObj [ ] ) => void
7777 expandNode : ( nodeObj : NodeObj ) => void
78+ changeDirection : ( direction : number ) => void
7879 linkDiv : ( ) => void
7980 scale : ( scale : number ) => void
8081 move : ( data : { dx : number ; dy : number } ) => void
You can’t perform that action at this time.
0 commit comments