mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Don't allow core:close event to bubble out of Pane
This commit is contained in:
committed by
probablycorey
parent
8f980a0f20
commit
2ba63e608f
@@ -93,11 +93,16 @@ describe "Pane", ->
|
||||
expect(editSession2.destroyed).toBeTruthy()
|
||||
|
||||
describe "core:close", ->
|
||||
it "removes the current item", ->
|
||||
it "removes the current item and does not bubble the event", ->
|
||||
containerCloseHandler = jasmine.createSpy("containerCloseHandler")
|
||||
container.on 'core:close', containerCloseHandler
|
||||
|
||||
initialItemCount = pane.getItems().length
|
||||
pane.trigger 'core:close'
|
||||
expect(pane.getItems().length).toBe initialItemCount - 1
|
||||
|
||||
expect(containerCloseHandler).not.toHaveBeenCalled()
|
||||
|
||||
describe "pane:show-next-item and pane:show-previous-item", ->
|
||||
it "advances forward/backward through the pane's items, looping around at either end", ->
|
||||
expect(pane.currentItem).toBe view1
|
||||
|
||||
@@ -68,6 +68,7 @@ class Pane extends View
|
||||
|
||||
removeCurrentItem: =>
|
||||
@removeItem(@currentItem)
|
||||
false
|
||||
|
||||
removeItem: (item) ->
|
||||
@showNextItem() if item is @currentItem and @items.length > 1
|
||||
|
||||
Reference in New Issue
Block a user