Have there been issues w/ posting to this group, I think this is my 11th try... oh well, lets try one more time... I have a list of draggable items that can be dropped into 1 of 7droppable receiving elements. This works perfect in Firefox 2 and Opera 9.10. In IE 7 it works correctly the first time something is dragged/dropped, but after that it just says there''s an error on the page and will not let anything behave as a draggable. If you reload the page, you can drag/drop 1 time and the whole cycle repeats. When the draggable is dropped into one of the receiving elements, the partial the receiving elements are on is refreshed via rjs using a partial. The list of draggables is not. Anyways I have no clue what it is doing, what breaks, or any way to see what the error message refers to in IE 7 (at least I don''t know of a tool to see it. The error consoles in the firefox/opera browsers don''t show anything wrong...). Pretty much a newbie on RoR. Currently running on 1.1.6 and using webbrick as my local webserver. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christopher Plawchan
2007-Jan-09 01:24 UTC
IE7 and scriptaculous drag/drop not working right
Have there been issues w/ posting to this group, I think this is my 12th try... oh well, lets try one more time... I have a list of draggable items that can be dropped into 1 of 7droppable receiving elements. This works perfect in Firefox 2 and Opera 9.10. In IE 7 it works correctly the first time something is dragged/dropped, but after that it just says there''s an error on the page and will not let anything behave as a draggable. If you reload the page, you can drag/drop 1 time and the whole cycle repeats. When the draggable is dropped into one of the receiving elements, the partial the receiving elements are on is refreshed via rjs using a partial. The list of draggables is not. Anyways I have no clue what it is doing, what breaks, or any way to see what the error message refers to in IE 7 (at least I don''t know of a tool to see it. The error consoles in the firefox/opera browsers don''t show anything wrong...). Pretty much a newbie on RoR. Currently running on 1.1.6 and using webbrick as my local webserver. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
papaSnowShoveler
2007-Jan-12 02:50 UTC
Re: IE7 and scriptaculous drag/drop not working right
Ok, it is throwing an error at line 2196 of the prototype.js Here''s a chunk of the javascript (below). Line 2196 is the "} while(element);" line. After dragging/dropping the first draggable, the partial with the drop zones is reloaded via ajax and the partial with the items being dragged is NOT reloaded. When you go to grab and drag another item to the drop zones, an error occurs and that line is flagged as the source of the error. Any clue what may cause this? Its an IE 7 problem, works fine in FF. Bad .css on my part? Thanks! cumulativeOffset: function(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; } while (element); return [valueL, valueT]; }, --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
papaSnowShoveler
2007-Jan-12 02:51 UTC
Re: IE7 and scriptaculous drag/drop not working right
Ok, it is throwing an error at line 2196 of the prototype.js Here''s a chunk of the javascript (below). Line 2196 is the "} while(element);" line. After dragging/dropping the first draggable, the partial with the drop zones is reloaded via ajax and the partial with the items being dragged is NOT reloaded. When you go to grab and drag another item to the drop zones, an error occurs and that line is flagged as the source of the error. Any clue what may cause this? Its an IE 7 problem, works fine in FF. Bad .css on my part? Thanks! cumulativeOffset: function(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; } while (element); return [valueL, valueT]; }, --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Jan-12 08:18 UTC
Re: IE7 and scriptaculous drag/drop not working right
papaSnowShoveler a écrit :> line. After dragging/dropping the first draggable, the partial with > the drop zones is reloaded via ajax and the partial with the itemsAssuming you''re indeed reloading the fragment containing droppables (not just reloading a droppable''s content), here''s a question: Did you unregister all the droppables prior to removing them from the DOM? If you don''t, you''re bound to stumble unto such issues, I believe. I assume once you''ve reloaded the fragment, you have a script in there that registers all elements as droppables again. What of the former droppable elements? -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
papaSnowShoveler
2007-Jan-15 03:23 UTC
Re: IE7 and scriptaculous drag/drop not working right
> I assume once you''ve reloaded the fragment, you have a script in there > that registers all elements as droppables again. What of the former > droppable elements?I assumed that in the .rjs template the page.replace_html.... code would handle this. There are 2 partials. One has all the draggable items, and the other consists of drop_receiving_elements . when a draggable lands in one, it calls an action in the controller, adding some data depending on which element it was dropped in to. The .rjs replaces the div that contains that partial. The items in the drop receiving elements are not draggables. I set up the drop receiving elements in the partial. Here''s the partial that I''m replacing. Again, this seems to be an IE 7 thing, it behaves fine in Firefox and opera (even if the items in the droppables are made draggable!) : This week began on: <%= (pass_monday(Date.today)).to_s %> <table class="goaltbl" width ="100%" height= "30%" border="1"> <tr height = "10%"> <%0.upto(6) do |x|%> <th class="goaltbl" width ="14.2%" > <%= (@start_of_week + x).strftime("%m/%d/%Y")%> </th> <%end%> </tr> <tr> <%0.upto(6) do |x|%> <td width ="14.2%" > <div class="goaltbl" id= "planned_goals<%=x.to_s%>" > <ul id="planned_goal_list"> <%goal_list_by_date (@start_of_week + x) %> <%for goal in @scheduled_goals%> <% domid = "goal_#{goal.id}" %> <li style="background-color: <%=h(goal.role.color)%>" class="available_goal" id="<%= domid%>"> <% form_for :goal, goal do |f|%> <%= f.check_box :completed, :onclick=> remote_function(:url => {:action=>"goal_check", :id=> goal.id, :completed=> goal.completed}, :method => :post, :before => "$(''spinner'').show();" , :complete => "$(''spinner'').hide();") %> <% end %> <%=goal.summary%> </li> <%end%> </ul> </div> </td> <%end%> </tr> </table> <%0.upto(6) do |x|%> <%= drop_receiving_element("planned_goals#{x.to_s}", #:update => "goal_table", :accept => ''available_goal'', :before => "$(''spinner'').show();" , :complete => "$(''spinner'').hide();" , :hoverclass => ''hover'', :with => "''goal='' + encodeURIComponent(element.id.split(''_'').last())" , :url => {:controller=> "schedule", :action=>"goal_planned", :the_day=> x })%> <%end%> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
papaSnowShoveler
2007-Jan-16 03:15 UTC
Re: IE7 and scriptaculous drag/drop not working right
Ah Ha!! Chris - I thought more about what you said about unregistering the droppables. What I did was add a line in the .rjs that gets called after the controller action runs its course. I added a remove statement to remove the divs that contained the drop receiving elements. For example, the id of one of the divs with the drop receiving elements was "planned_goals0", so I just added page.remove "planned_goals0" prior to the page.replace_html statement and it works!! So, by using the page.remove statement, I "unregister all the droppables prior to removing them" as you had said to do. Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, i had the same problem and i could fix it doing that papaSnowShoveler told here. Is necessary first remove all the dropppables before make the change of the content where will whow the new dropabbles. Remember that each time you remove a droppable, change the lenght of the droppables collection. On Jan 15, 7:15 pm, "papaSnowShoveler" <acp...-H+0wwilmMs3R7s880joybQ@public.gmane.org> wrote:> Ah Ha!! > > Chris - I thought more about what you said about unregistering the > droppables. What I did was add a line in the .rjs that gets called > after the controller action runs its course. I added a remove > statement to remove the divs that contained the drop receiving > elements. For example, the id of one of the divs with the drop > receiving elements was "planned_goals0", so I just added > > page.remove "planned_goals0" > > prior to the page.replace_html statement and it works!! So, by using > the page.remove statement, I "unregister all the droppables prior to > removing them" as you had said to do. > > Thanks!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---