mirror of
https://github.com/atom/atom.git
synced 2026-01-27 07:47:58 -05:00
pass event to shouldAllow* methods
This commit is contained in:
@@ -14,7 +14,7 @@ class SortableList extends View
|
||||
@on 'drop', '.sortable', @onDrop
|
||||
|
||||
onDragStart: (event) =>
|
||||
return false if !@shouldAllowDrag()
|
||||
return false if !@shouldAllowDrag(event)
|
||||
|
||||
el = @getSortableElement(event)
|
||||
el.addClass 'is-dragging'
|
||||
@@ -34,14 +34,14 @@ class SortableList extends View
|
||||
@getSortableElement(event).removeClass 'is-drop-target'
|
||||
|
||||
onDrop: (event) =>
|
||||
return false if !@shouldAllowDrop()
|
||||
return false if !@shouldAllowDrop(event)
|
||||
event.stopPropagation()
|
||||
@find('.is-drop-target').removeClass 'is-drop-target'
|
||||
|
||||
shouldAllowDrag: ->
|
||||
shouldAllowDrag: (event) ->
|
||||
true
|
||||
|
||||
shouldAllowDrop: ->
|
||||
shouldAllowDrop: (event) ->
|
||||
true
|
||||
|
||||
getDroppedElement: (event) ->
|
||||
|
||||
@@ -45,7 +45,7 @@ class TabView extends SortableList
|
||||
removeTabAtIndex: (index) ->
|
||||
@find(".tab:eq(#{index})").remove()
|
||||
|
||||
shouldAllowDrag: ->
|
||||
shouldAllowDrag: (event) ->
|
||||
panes = rootView.find('.pane')
|
||||
!(panes.length == 1 && panes.find('.sortable').length == 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user