mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04:00
Add comment explaining utility of _enableDraghover
This commit is contained in:
@@ -312,6 +312,16 @@ $.extend(fileInputBinding, {
|
||||
_zoneOf: function(el) {
|
||||
return $(el).closest("div.input-group");
|
||||
},
|
||||
// This function makes it possible to attach listeners to the dragenter,
|
||||
// dragleave, and drop events of a single element with children. It's not
|
||||
// intuitive to do directly because outer elements fire "dragleave" events
|
||||
// both when the drag leaves the element and when the drag enters a child. To
|
||||
// make it easier, we maintain a count of the elements being dragged across
|
||||
// and trigger 3 new types of event:
|
||||
//
|
||||
// 1. draghover:enter - When a drag enters el and any of its children.
|
||||
// 2. draghover:leave - When the drag leaves el and all of its children.
|
||||
// 3. draghover:drop - When an item is dropped on el or any of its children.
|
||||
_enableDraghover: function(el) {
|
||||
let $el = $(el),
|
||||
childCounter = 0;
|
||||
|
||||
Reference in New Issue
Block a user