mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Add new item before destroying pending item
Fixes atom/tabs#278 Signed-off-by: Michelle Tilley <binarymuse@github.com>
This commit is contained in:
committed by
Michelle Tilley
parent
2bdf4be904
commit
e620232d35
@@ -433,11 +433,11 @@ class Pane extends Model
|
||||
@subscriptionsPerItem.set item, itemSubscriptions
|
||||
|
||||
@items.splice(index, 0, item)
|
||||
pendingItem = @getPendingItem()
|
||||
@destroyItem(pendingItem) if pendingItem?
|
||||
lastPendingItem = @getPendingItem()
|
||||
@setPendingItem(item) if pending
|
||||
|
||||
@emitter.emit 'did-add-item', {item, index, moved}
|
||||
@destroyItem(lastPendingItem) if lastPendingItem?
|
||||
@setActiveItem(item) unless @getActiveItem()?
|
||||
item
|
||||
|
||||
|
||||
Reference in New Issue
Block a user