mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
@@ -184,6 +184,8 @@ describe "Pane", ->
|
||||
pane.destroyItem(item) for item in pane.getItems()
|
||||
expect(pane.isDestroyed()).toBe false
|
||||
expect(pane.activeItem).toBeUndefined()
|
||||
expect(-> pane.saveActiveItem()).not.toThrow()
|
||||
expect(-> pane.saveActiveItemAs()).not.toThrow()
|
||||
|
||||
describe "when the 'core.destroyEmptyPanes' config option is true", ->
|
||||
it "destroys the pane", ->
|
||||
|
||||
@@ -239,7 +239,7 @@ class Pane extends Model
|
||||
# * item: The item to save.
|
||||
# * nextAction: An optional function which will be called after the item is saved.
|
||||
saveItem: (item, nextAction) ->
|
||||
if item.getUri?()
|
||||
if item?.getUri?()
|
||||
item.save?()
|
||||
nextAction?()
|
||||
else
|
||||
@@ -250,7 +250,7 @@ class Pane extends Model
|
||||
# * item: The item to save.
|
||||
# * nextAction: An optional function which will be called after the item is saved.
|
||||
saveItemAs: (item, nextAction) ->
|
||||
return unless item.saveAs?
|
||||
return unless item?.saveAs?
|
||||
|
||||
itemPath = item.getPath?()
|
||||
itemPath = dirname(itemPath) if itemPath
|
||||
|
||||
Reference in New Issue
Block a user