11{Emitter } = require ' emissary'
22MinimapView = require ' ./minimap-view'
3+ Debug = require ' prolix'
34
45require ' ../vendor/resizeend'
56
67class Minimap
78 Emitter .includeInto (this )
9+ Debug (' minimap' ).includeInto (this )
810
911 # We'll be storing each MinimapView using the id of their PaneView
1012 minimapViews : {}
@@ -13,11 +15,8 @@ class Minimap
1315 # minimapViews object will never be set to null.
1416 active : false
1517
16- # Does the minimap debug features are activated on toggle
17- allowDebug : false
18-
1918 activate : ->
20- atom .workspaceView .command ' minimap:toggle' , => @ toggle ()
19+ atom .workspaceView .command ' minimap:toggle' , => @ toggleNoDebug ()
2120 atom .workspaceView .command ' minimap:toggle-debug' , => @ toggleDebug ()
2221
2322 deactivate : ->
@@ -26,8 +25,7 @@ class Minimap
2625 @minimapViews = {}
2726 @ emit (' deactivated' )
2827
29- toggle : (debugMode = false ) ->
30- @allowDebug = debugMode
28+ toggle : () ->
3129 if @active
3230 @active = false
3331 @ deactivate ()
@@ -37,7 +35,12 @@ class Minimap
3735 @ emit (' activated' )
3836
3937 toggleDebug : ->
40- @ toggle (true )
38+ @ getChannel ().activate ()
39+ @ toggle ()
40+
41+ toggleNoDebug : ->
42+ @ getChannel ().deactivate ()
43+ @ toggle ()
4144
4245 updateAllViews : ->
4346 view .onScrollViewResized () for id,view of @minimapViews
@@ -55,7 +58,7 @@ class Minimap
5558 # the callback.
5659 @eachPaneViewSubscription = atom .workspaceView .eachPaneView (paneView) =>
5760 paneId = paneView .model .id
58- view = new MinimapView (paneView, @allowDebug )
61+ view = new MinimapView (paneView)
5962 view .onActiveItemChanged (paneView .getActiveItem ())
6063 @ updateAllViews ()
6164
0 commit comments