Add Pane::onDidMoveItem()

This commit is contained in:
Nathan Sobo
2014-08-27 10:08:58 -06:00
parent b8fcbe9451
commit 9bd2eec4bc
2 changed files with 19 additions and 7 deletions

View File

@@ -100,6 +100,9 @@ class Pane extends Model
onDidRemoveItem: (fn) ->
@emitter.on 'did-remove-item', fn
onDidMoveItem: (fn) ->
@emitter.on 'did-move-item', fn
onDidChangeActiveItem: (fn) ->
@emitter.on 'did-change-active-item', fn
@@ -230,6 +233,7 @@ class Pane extends Model
@items.splice(oldIndex, 1)
@items.splice(newIndex, 0, item)
@emit 'item-moved', item, newIndex
@emitter.emit 'did-move-item', {item, oldIndex, newIndex}
# Public: Moves the given item to the given index at another pane.
moveItemToPane: (item, pane, index) ->