diff --git a/spec/pane-view-spec.coffee b/spec/pane-view-spec.coffee index e8311b482..2bff010e7 100644 --- a/spec/pane-view-spec.coffee +++ b/spec/pane-view-spec.coffee @@ -122,10 +122,10 @@ describe "PaneView", -> beforeEach -> paneModel.activateItem(editor1) - it "adds its file path to the active pane", -> + it "adds the file path as a data attribute to the pane", -> expect(pane).toHaveAttr('data-active-item-path') - it "adds its file name to the active pane", -> + it "adds the file name as a data attribute to the pane", -> expect(pane).toHaveAttr('data-active-item-name') describe "when the new activeItem does not implement ::getPath", -> @@ -133,10 +133,10 @@ describe "PaneView", -> paneModel.activateItem(editor1) paneModel.activateItem(document.createElement('div')) - it "removes its file path from the active pane", -> + it "does not add the file path as a data attribute to the pane", -> expect(pane).not.toHaveAttr('data-active-item-path') - it "removes its file name from the active pane", -> + it "does not add the file name as data attribute to the pane", -> expect(pane).not.toHaveAttr('data-active-item-name') describe "when an item is destroyed", -> diff --git a/src/pane-element.coffee b/src/pane-element.coffee index 2f0481829..fec8904fb 100644 --- a/src/pane-element.coffee +++ b/src/pane-element.coffee @@ -1,3 +1,4 @@ +path = require 'path' {CompositeDisposable} = require 'event-kit' Grim = require 'grim' {$, callAttachHooks, callRemoveHooks} = require './space-pen-extensions' @@ -72,7 +73,6 @@ class PaneElement extends HTMLElement itemView = atom.views.getView(item) if itemPath = item.getPath?() - path = require 'path' @dataset.activeItemName = path.basename(itemPath) @dataset.activeItemPath = itemPath else