Skip to content

Commit

Permalink
Add a setStandAlone method on minimap and dispatch a dedicated event …
Browse files Browse the repository at this point in the history
…on change
  • Loading branch information
abe33 committed Aug 16, 2015
1 parent fa5dc97 commit 1e3e5f7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/minimap.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ class Minimap
onDidChangeScrollLeft: (callback) ->
@emitter.on 'did-change-scroll-left', callback

# Calls the `callback` when the text editor stand-alone mode is modified
#
# callback - The callback {Function}. The event the callback will receive
# the {Minimap} as the sole argument.
#
# Returns a `Disposable`.
onDidChangeStandAlone: (callback) ->
@emitter.on 'did-change-stand-alone', callback


# Calls the `callback` when this {Minimap} was destroyed.
#
# callback - The callback {Function}.
Expand All @@ -147,6 +157,15 @@ class Minimap
# Returns a {Boolean}.
isStandAlone: -> @standAlone

# Sets the stand-alone mode for this minimap.
#
# standAlone - A {Boolean} of whether the minimap operates in stand-alone
# mode or not.
setStandAlone: (standAlone) ->
if standAlone isnt @standAlone
@standAlone = standAlone
@emitter.emit('did-change-stand-alone', this)

# Returns the `TextEditor` that this minimap represents.
#
# Returns a `TextEditor`.
Expand Down

0 comments on commit 1e3e5f7

Please sign in to comment.