On 2/23/06, Tarek Ziadé <[EMAIL PROTECTED]> wrote: > When the dom is reloaded, the drag/drop features reloads Droppable.drops > elements.
I think this statement is the heart of your problem. There's nothing active about scriptaculous (where you're getting the Draggables/Droppables from) that would check for a DOM "reload" (I'm not sure what that is? any change, perhaps?); I'm not even sure that kind of information is available to JavaScript. I don't know much about scriptaculous, so don't take this as the final answer, but the magic that makes Draggables/Droppables work are the events that are attached to each element that you make Draggable/Droppable. When you use .innerHTML on those elements' parent, you're effectively destroying the existing elements (and their event associations) and creating what might look like identical elements, but they're not; they don't have the events unless you programatically re-initialize the Draggables/Droppables. > refreshPortletCompleted: function(originalRequest) { > // getting new positions from the server > result = originalRequest.responseText; > > if (result!='') { > $(this.last_portlet_id).innerHTML = result; > var newdiv = document.createElement("div"); > newdiv.innerHTML = result; > newdiv.id = this.last_portlet_id; > olddiv = $(this.last_portlet_id); > parent = olddiv.parentNode; > olddiv.parentNode.replaceChild(newdiv, olddiv); > } > }, Isn't most of this code redundant? You only need to use innerHTML on the existing div, or create a new div and replace the old one. Either one achieves the same DOM structure in the end. You also never use 'parent' anywhere. Todd _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs