Use the "here" option to open for drag-and-drop

This commit is contained in:
Ash Wilson
2019-05-01 09:05:46 -04:00
parent 61377b843c
commit e2d5143b53
2 changed files with 2 additions and 2 deletions

View File

@@ -263,7 +263,7 @@ describe "PaneElement", ->
event = buildDragEvent("drop", [{path: "/fake1"}, {path: "/fake2"}])
paneElement.dispatchEvent(event)
expect(atom.applicationDelegate.open.callCount).toBe 1
expect(atom.applicationDelegate.open.argsForCall[0][0]).toEqual pathsToOpen: ['/fake1', '/fake2']
expect(atom.applicationDelegate.open.argsForCall[0][0]).toEqual pathsToOpen: ['/fake1', '/fake2'], here: true
describe "when a non-file is dragged to the pane", ->
it "does nothing", ->

View File

@@ -62,7 +62,7 @@ class PaneElement extends HTMLElement {
this.getModel().activate()
const pathsToOpen = [...event.dataTransfer.files].map(file => file.path)
if (pathsToOpen.length > 0) {
this.applicationDelegate.open({pathsToOpen})
this.applicationDelegate.open({pathsToOpen, here: true})
}
}
this.addEventListener('focus', handleFocus, true)