atom feed4 messages in com.googlegroups.prototype-scriptaculous[Proto-Scripty] Re: dropOnEmpty:true ...
FromSent OnAttachments
SumitaOct 10, 2008 5:14 am 
Tobias GassmannNov 8, 2008 5:04 am 
gwinemanNov 17, 2008 5:22 am 
James McBryanDec 10, 2008 5:16 pm 
Subject:[Proto-Scripty] Re: dropOnEmpty:true causing flickering ?
From:Tobias Gassmann (tob@gaszmann.de)
Date:Nov 8, 2008 5:04:49 am
List:com.googlegroups.prototype-scriptaculous

Hi,

I applied a quick and dirty hack to the "onEmptyHover"-function to get rid of the flickering when using dropOnEmpty --> onEmptyHover: function(element, dropon, overlap) { (it's in the dragdrop.js-file)

There is an if-statement in this function which has to be altered:

the original line in Version 1.8.1 of scriptaculous reads: --> " if(!Element.isParent(dropon, element)) {"

changing this line to --> " if((!Element.isParent(dropon, element)) && (Element.empty(dropon))) {" turned the flickering off.

This can only be used, in case there are no other html-elements in the empty "Drop-On"-Element. Otherwise it remains undroppable.

The reason for the flickering is (as far as I figured it out) the Element.isParent(dropon,element) returning false, even when the dragged item is still within it's original parent. By checking wether the underlying Droppable is really empty (and therefore not the home- droppable, where the dragged item came from), we can assure that the onEmptyHover-Code is not executed falsely.

This is only a quick and dirty hack, I did not completely analyze the scriptaculous-code, so it might not work for everyone.

bye! Tobias

On Oct 10, 1:15 pm, Sumita <sumi@gmail.com> wrote:

Hi, I have a horizontal sortable with three images arranged horizontally in a div (images in a div tag). The moment I introduce dropOnEmpty:true, and I try to drop an image from another sortable, there is a flickering and the sortable is creates its own drop position. Can you suggest a solution??