Guest User

Untitled

a guest
Feb 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. Droppables.isAffected = function(point, element, drop) {
  2. return (
  3. (drop.element!=element) &&
  4. ((!drop._containers) ||
  5. this.isContained(element, drop)) &&
  6. ((!drop.accept) ||
  7. (Element.classNames(element).detect(
  8. function(v) { return drop.accept.include(v) } ) )) &&
  9. Position.withinIncludingScrolloffsets(drop.element, point[0], point[1]) );
  10. }
  11.  
  12. Droppables.show = function(point, element) {
  13. if(!this.drops.length) return;
  14. var drop, affected = [];
  15.  
  16. this.drops.each( function(drop) {
  17. if(Droppables.isAffected(point, element, drop))
  18. affected.push(drop);
  19. });
  20.  
  21. if(affected.length>0)
  22. drop = Droppables.findDeepestChild(affected);
  23.  
  24. if(this.last_active && this.last_active != drop) this.deactivate(this.last_active);
  25. if (drop) {
  26. Position.withinIncludingScrolloffsets(drop.element, point[0], point[1]);
  27. if(drop.onHover)
  28. drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
  29.  
  30. if (drop != this.last_active) Droppables.activate(drop);
  31. }
  32. }
Add Comment
Please, Sign In to add comment