mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Call Pane.destroyItem when close icon is clicked on a tab
This commit is contained in:
committed by
probablycorey
parent
7aba839dac
commit
47621bd3b2
@@ -39,7 +39,7 @@ class TabBarView extends SortableList
|
||||
|
||||
@on 'click', '.tab .close-icon', (e) =>
|
||||
tab = $(e.target).closest('.tab').view()
|
||||
@pane.removeItem(tab.item)
|
||||
@pane.destroyItem(tab.item)
|
||||
false
|
||||
|
||||
@pane.prepend(this)
|
||||
|
||||
@@ -89,12 +89,13 @@ fdescribe "TabBarView", ->
|
||||
expect(pane.focus.callCount).toBe 2
|
||||
|
||||
describe "when a tab's close icon is clicked", ->
|
||||
it "removes the tab's item from the pane", ->
|
||||
tabBar.tabForItem(item1).find('.close-icon').click()
|
||||
it "destroys the tab's item on the pane", ->
|
||||
tabBar.tabForItem(editSession1).find('.close-icon').click()
|
||||
expect(pane.getItems().length).toBe 2
|
||||
expect(pane.getItems().indexOf(item1)).toBe -1
|
||||
expect(pane.getItems().indexOf(editSession1)).toBe -1
|
||||
expect(editSession1.destroyed).toBeTruthy()
|
||||
expect(tabBar.getTabs().length).toBe 2
|
||||
expect(tabBar.find('.tab:contains(Item 1)')).not.toExist()
|
||||
expect(tabBar.find('.tab:contains(sample.js)')).not.toExist()
|
||||
|
||||
describe "when a tab item's title changes", ->
|
||||
it "updates the title of the item's tab", ->
|
||||
|
||||
Reference in New Issue
Block a user