mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
🎨
This commit is contained in:
@@ -121,19 +121,23 @@ describe "PaneView", ->
|
||||
describe "when the new activeItem implements ::getPath", ->
|
||||
beforeEach ->
|
||||
paneModel.activateItem(editor1)
|
||||
|
||||
it "adds its file path to the active pane", ->
|
||||
expect(pane).toHaveAttr('data-active-path')
|
||||
expect(pane).toHaveAttr('data-active-item-path')
|
||||
|
||||
it "adds its file name to the active pane", ->
|
||||
expect(pane).toHaveAttr('data-active-name')
|
||||
expect(pane).toHaveAttr('data-active-item-name')
|
||||
|
||||
describe "when the new activeItem does not implement ::getPath", ->
|
||||
beforeEach ->
|
||||
paneModel.activateItem(editor1)
|
||||
paneModel.activateItem(document.createElement('div'))
|
||||
|
||||
it "removes its file path from the active pane", ->
|
||||
expect(pane).not.toHaveAttr('data-active-path')
|
||||
expect(pane).not.toHaveAttr('data-active-item-path')
|
||||
|
||||
it "removes its file name from the active pane", ->
|
||||
expect(pane).not.toHaveAttr('data-active-name')
|
||||
expect(pane).not.toHaveAttr('data-active-item-name')
|
||||
|
||||
describe "when an item is destroyed", ->
|
||||
it "triggers the 'pane:item-removed' event with the item and its former index", ->
|
||||
|
||||
@@ -73,8 +73,8 @@ class PaneElement extends HTMLElement
|
||||
|
||||
if itemPath = item.getPath?()
|
||||
path = require 'path'
|
||||
@dataset.activeName = path.basename(itemPath)
|
||||
@dataset.activePath = itemPath
|
||||
@dataset.activeItemName = path.basename(itemPath)
|
||||
@dataset.activeItemPath = itemPath
|
||||
else
|
||||
delete @dataset.activeName
|
||||
delete @dataset.activePath
|
||||
|
||||
Reference in New Issue
Block a user