Allow dragging of tab when there is only one tab.

The tabs should be able to be draggale out of the application at any
time, and if there is only one tab it should not be able to be dropped
in the same window.
This commit is contained in:
Cheng Zhao
2013-04-09 15:33:41 +08:00
parent 3c4966f6a3
commit a5b8478060

View File

@@ -77,11 +77,8 @@ class TabBarView extends View
(@paneContainer.getPanes().length > 1) or (@pane.getItems().length > 1)
onDragStart: (event) =>
unless @shouldAllowDrag(event)
event.preventDefault()
return
event.originalEvent.dataTransfer.setData 'atom-event', 'true'
if @shouldAllowDrag()
event.originalEvent.dataTransfer.setData 'atom-event', 'true'
el = $(event.target).closest('.sortable')
el.addClass 'is-dragging'