logo       

Re: draggable revert problem: msg#00155

lang.ruby.rails.spinoffs

Subject: Re: draggable revert problem

Thanks,
The bug was informative, but my application pretty much replicates what the cart example does except for adding images instead of products. so Iam not adding it to any html list. Here is my code. Like I said before, the revert works fine when I dont add the object to the cart. The revert also works fine when the same object is added twice to the cart. The third time its added to the cart, it reverts a few pixels off and from then on, it goes all over the page.

<h1>New entry</h1>
<%= _javascript__include_tag "prototype" %>
<%= define_javascript_functions %>
<%= link_to 'Back', :action ="" 'list' %>

<h3>Add to list using Ajax</h3>
    <%= form_remote_tag(:update => "pictures",
                                            :loading => "Element.show('indicator')",
                                            :complete =>"Element.hide('indicator')",
                           :url ="" { :action ="" :add_item },
                           :position => "top" ) %>
      New item text:
      <%= text_field_tag :newitem %>
      <%= text_field_tag :flickrid %>
      <%= submit_tag "Add item with Ajax" %>
   
   
    <div style="height:40px;padding-top:10px;">
                <p id="indicator" style="display:none;margin-top:0px;">
                  <%= image_tag "indicator.gif" %> Updating pics...
                </p>
        </div>
  
    <div id="pictures" style="clear:right;z-index:1;height:132px;margin-top:10px;">
    <div style="clear:both;"></div>
      </div>
      <%= end_form_tag %>
     
     
     
  <div id="cart" class="cart"  style="clear:right;z-index:1;height:132px;margin-top:10px;"> 
 
      <div id="items">
         
                 <%= render :partial => "cart" %>
      </div>
      <div style="clear:both;"></div>
    </div>
       
   
    <%= drop_receiving_element "cart",
      :update => "items", :url ="" { :action ="" "add"  },
      :accept => "photo_list", :hoverclass => "cart-active",
      :loading => "Element.show('indicator')",
      :complete => "Element.hide('indicator')" %>
       
 ************************* Partial View - Photo

<% if (session[:flickrid] != '' && @photos != nil) %>

        <%= image_tag " #{photo.source('Square')}",
                                                :tag => 'pictures',
                                        :id => "#{photo.source('Small')}",
                                        :alt => photo.source('Square'),
                                         :class => "photo_list",
                                         :style => "clear:both;"  %>
            <%= draggable_element "#{photo.source('Small')}", :revert => true %>
         
<% end %>

************************* partial View Cart

<% session[:cart].photos.each do |photo| %>
        <%= image_tag "#{photo}",
                                :id => "#{photo}",
                                   :style => "position:relative;" %>
      <%= draggable_element "#{photo}", :revert => true %>
<% end %>
<%= "Here's your photo cart." if session[:cart].photos.empty? %>


Thanks for the help.

Sunder

On 11/30/05, Grzesiek Slusarek <gregtech@xxxxx> wrote:
>Hi maybe this is the answer..
http://dev.rubyonrails.org/ticket/2987

Best wishes..
Grzegorz Ślusarek
Dnia 30-11-2005 o godz. 2:14 Sunder napisał(a):
I found that the revert works perfect, if I dont add an item to the cart.



----------------------------------------------------
Andrzejki - wróżby tylko dla pań!
Katarzynki - wróżby tylko dla kawalerów!
Sprawdź - zanim będzie za późno ;)
http://klik.wp.pl/?adr=http://adv.reklama.wp.pl/as/handrzejki.html&sid=581
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@xxxxxxxxxxxxxxxxxxxxx
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs





--
<a href="" href="http://www.sunderiyer.com"">http://www.sunderiyer.com"><img src="" href="http://feeds.feedburner.com/SunderIyer.gif">http://feeds.feedburner.com/SunderIyer.gif" height="67" width="200" style="border:0" alt="Sunder Iyer"/></a> _______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@xxxxxxxxxxxxxxxx
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise