Hiya there! I''m using This combo for reloading the page content; -Effect.BlindUp -Effect.Fade -Ajax.Updater -Effect.BlindDown -Effect.Appear All of this is handled as one function updateContent(); Now I use this function in a link (onclick="updateContent(''hereTheNewPage'');"). Now when I double click on a link with that function the BlindDown / BlindUp crashes. Its hard to explain but take a look at this demo site : http://cliffordjames.wobutidau.com Is there a way to fix this? Thanks, Clifford James --~--~---------~--~----~------------~-------~--~----~ 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 James, I''m sorry this isn''t an answer to your problem but I have had the same problems, multiple clicking sometimes causes the page to die having you to refresh it entirely. By the way, your page is broken in firefox. You should clear your content at the bottom of your content so when ajax updates the whole page grows with the content. You can do this by putting in a <div style="clear: both;"> </div> after your page content. That should fix it. On Mar 16, 9:55 am, "Clifford James" <Clifford.Ja...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hiya there! > > I''m using This combo for reloading the page content; > -Effect.BlindUp > -Effect.Fade > -Ajax.Updater > -Effect.BlindDown > -Effect.Appear > > All of this is handled as one function updateContent(); > > Now I use this function in a link > (onclick="updateContent(''hereTheNewPage'');"). > > Now when I double click on a link with that function the BlindDown / > BlindUp crashes. > > Its hard to explain but take a look at this demo site :http://cliffordjames.wobutidau.com > > Is there a way to fix this? > > Thanks, > > Clifford James--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Looking at your code, you could simply change <div class="boxad"> to <div class="boxad" style="clear:both;"> that works great. On Mar 16, 9:55 am, "Clifford James" <Clifford.Ja...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hiya there! > > I''m using This combo for reloading the page content; > -Effect.BlindUp > -Effect.Fade > -Ajax.Updater > -Effect.BlindDown > -Effect.Appear > > All of this is handled as one function updateContent(); > > Now I use this function in a link > (onclick="updateContent(''hereTheNewPage'');"). > > Now when I double click on a link with that function the BlindDown / > BlindUp crashes. > > Its hard to explain but take a look at this demo site :http://cliffordjames.wobutidau.com > > Is there a way to fix this? > > Thanks, > > Clifford James--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Colin Mollenhour
2007-Mar-16 14:42 UTC
Re: BlindUp / BlindDown crashes on multiple click...
A couple ways to go about this.. one, use a flag so that if one action is in progress you back out of the other. Not the best solution since if you click two different links you will get the results for the first and the user will be like "wtf mate, I clicked this and I got that". Or, you cancel the Ajax request that is in-progress and start the new one. I posted about canceling in-progress requests a while back but never submitted a patch for it but a patch is really the only way to do that because different browsers need special cases to cancel properly. I also suggested caching requests so that any in-progress requests could be canceled on page unload to prevent problems in IE. Another possibility, you could probably override the insertion function to use a queue of some sort, I dunno.. I personally would like to see a patch for Prototype that adds support for cancelling requests as this is really the correct solution. I laid the groundwork for it but don''t have the time or energy to get a patch accepted. Good luck, Colin Clifford James wrote:> Hiya there! > > I''m using This combo for reloading the page content; > -Effect.BlindUp > -Effect.Fade > -Ajax.Updater > -Effect.BlindDown > -Effect.Appear > > All of this is handled as one function updateContent(); > > Now I use this function in a link > (onclick="updateContent(''hereTheNewPage'');"). > > Now when I double click on a link with that function the BlindDown / > BlindUp crashes. > > Its hard to explain but take a look at this demo site : > http://cliffordjames.wobutidau.com > > Is there a way to fix this? > > Thanks, > > Clifford James > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Could the flag be a user-defined property of the anchor itself, such as [element].busy = [bool]? Your updateContent function could then check this.busy before starting another request/transition, and each link on the page would cap its requests independently. You could even prototype anchors to have a busy property of false by default to avoid undefined errors when groping for the property. The only problem I''ve noticed is that sometimes when trying to grab an anchor by id to access its properties I get the url string of the anchor instead of the element itself, as if anchors are "special" in some way (ffox). I don''t expect that issue in this implementation though. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I was thinking of using sessions, this might solve the problem if I get them to work... On 16 mrt, 16:34, "mangoduck" <mangod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Could the flag be a user-defined property of the anchor itself, such > as [element].busy = [bool]? Your updateContent function could then > check this.busy before starting another request/transition, and each > link on the page would cap its requests independently. You could even > prototype anchors to have a busy property of false by default to avoid > undefined errors when groping for the property. > > The only problem I''ve noticed is that sometimes when trying to grab an > anchor by id to access its properties I get the url string of the > anchor instead of the element itself, as if anchors are "special" in > some way (ffox). I don''t expect that issue in this implementation > though.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Well guys, I fixed it for now with some ugly code, have a look at this: function updateDiv(page) { if(!Cookie.get(''flag'')) { Cookie.set(''flag'', ''flag'', 1); new Effect.BlindUp(''begin''); new Effect.Fade(''begin''); setTimeout("new Ajax.Updater(''begin'', ''/pages/"+page+"'', {onComplete:function(){new Effect.BlindDown(''begin''); new Effect.Appear(''begin'');}, asynchronous:true, evalScripts:true});", 1500); setTimeout("Cookie.erase(''flag'')",1501); } } On 16 mrt, 10:55, "Clifford James" <Clifford.Ja...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hiya there! > > I''m using This combo for reloading the page content; > -Effect.BlindUp > -Effect.Fade > -Ajax.Updater > -Effect.BlindDown > -Effect.Appear > > All of this is handled as one function updateContent(); > > Now I use this function in a link > (onclick="updateContent(''hereTheNewPage'');"). > > Now when I double click on a link with that function the BlindDown / > BlindUp crashes. > > Its hard to explain but take a look at this demo site :http://cliffordjames.wobutidau.com > > Is there a way to fix this? > > Thanks, > > Clifford James--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ok I ripped out the setTimeout but I still have on idea how I and where I use this flag variable : function updateDiv(page) { if(!Cookie.get(''flag'')) { Cookie.set(''flag'', ''flag'', 1); new Effect.Fade(''begin''); new Effect.BlindUp(''begin'', {afterFinish:function() { new Ajax.Updater(''begin'', ''/pages/''+page, {onComplete:function(){ new Effect.Appear(''begin''); new Effect.BlindDown(''begin'', {afterFinish:function() { Cookie.erase(''flag''); }}); }, asynchronous:true, evalScripts:true}); }}); } } On 19 mrt, 13:16, Colin Mollenhour <eliteii...-NPSFNn/7+NYVo650/ln6uw@public.gmane.org> wrote:> Why use a cookie? It looks like the same thing could be accomplished with a simple JS variable.. Also, get rid of the setTimeout calls or at worst have setTimeout call a real function rather than passing it a string (which is eval''d, which is a no-no). > Effects have an afterFinish option which might be useful in this case... > Colin > Clifford James wrote:Well guys, I fixed it for now with some ugly code, have a look at this: function updateDiv(page) { if(!Cookie.get(''flag'')) { Cookie.set(''flag'', ''flag'', 1); new Effect.BlindUp(''begin''); new Effect.Fade(''begin''); setTimeout("new Ajax.Updater(''begin'', ''/pages/"+page+"'', {onComplete:function(){new Effect.BlindDown(''begin''); new Effect.Appear(''begin'');}, asynchronous:true, evalScripts:true});", 1500); setTimeout("Cookie.erase(''flag'')",1501); } } On 16 mrt, 10:55, "Clifford James"<Clifford.Ja...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:Hiya there! I''m using This combo for reloading the page content; -Effect.BlindUp -Effect.Fade -Ajax.Updater -Effect.BlindDown -Effect.Appear All of this is handled as one function updateContent(); Now I use this function in a link (onclick="updateContent(''hereTheNewPage'');"). Now when I double click on a link with that function the BlindDown / BlindUp crashes. Its hard to explain but take a look at this demo site :http://cliffordjames.wobutidau.comIs there a way to fix this? Thanks, Clifford James--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Colin Mollenhour
2007-Mar-19 12:16 UTC
Re: BlindUp / BlindDown crashes on multiple click...
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Why use a cookie? It looks like the same thing could be accomplished with a simple JS variable.. Also, get rid of the setTimeout calls or at worst have setTimeout call a real function rather than passing it a string (which is eval''d, which is a no-no).<br> Effects have an afterFinish option which might be useful in this case...<br> <br> Colin<br> <br> Clifford James wrote: <blockquote cite="mid:1174292896.778655.168910-8ox99JRHX6eLxTqHJMs4EmB/v6IoIuQBVpNB7YpNyf8@public.gmane.org" type="cite"> <pre wrap="">Well guys, I fixed it for now with some ugly code, have a look at this: function updateDiv(page) { if(!Cookie.get(''flag'')) { Cookie.set(''flag'', ''flag'', 1); new Effect.BlindUp(''begin''); new Effect.Fade(''begin''); setTimeout("new Ajax.Updater(''begin'', ''/pages/"+page+"'', {onComplete:function(){new Effect.BlindDown(''begin''); new Effect.Appear(''begin'');}, asynchronous:true, evalScripts:true});", 1500); setTimeout("Cookie.erase(''flag'')",1501); } } On 16 mrt, 10:55, "Clifford James" <a class="moz-txt-link-rfc2396E" href="mailto:Clifford.Ja...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"><Clifford.Ja...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org></a> wrote: </pre> <blockquote type="cite"> <pre wrap="">Hiya there! I''m using This combo for reloading the page content; -Effect.BlindUp -Effect.Fade -Ajax.Updater -Effect.BlindDown -Effect.Appear All of this is handled as one function updateContent(); Now I use this function in a link (onclick="updateContent(''hereTheNewPage'');"). Now when I double click on a link with that function the BlindDown / BlindUp crashes. Its hard to explain but take a look at this demo site :<a class="moz-txt-link-freetext" href="http://cliffordjames.wobutidau.com">http://cliffordjames.wobutidau.com</a> Is there a way to fix this? Thanks, Clifford James </pre> </blockquote> <pre wrap=""><!----> </pre> </blockquote> <br> --~--~---------~--~----~------------~-------~--~----~<br> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. <br> To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <br> For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en <br> -~----------~----~----~----~------~----~------~--~---<br> </body> </html> <br>
Since I removed the setTimeout I see some flickering when de page finishes loading and the effects BlindDown and Appear are being activated... On 19 mrt, 13:09, "Clifford James" <Clifford.Ja...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Ok I ripped out the setTimeout but I still have on idea how I and > where I use this flag variable : > > function updateDiv(page) { > if(!Cookie.get(''flag'')) { > Cookie.set(''flag'', ''flag'', 1); > new Effect.Fade(''begin''); > new Effect.BlindUp(''begin'', {afterFinish:function() { > new Ajax.Updater(''begin'', ''/pages/''+page, {onComplete:function(){ > new Effect.Appear(''begin''); > new Effect.BlindDown(''begin'', {afterFinish:function() { > Cookie.erase(''flag''); > }}); > }, asynchronous:true, evalScripts:true}); > }}); > } > > } > > On 19 mrt, 13:16, Colin Mollenhour <eliteii...-NPSFNn/7+NYVo650/ln6uw@public.gmane.org> wrote: > > > Why use a cookie? It looks like the same thing could be accomplished with a simple JS variable.. Also, get rid of the setTimeout calls or at worst have setTimeout call a real function rather than passing it a string (which is eval''d, which is a no-no). > > Effects have an afterFinish option which might be useful in this case... > > Colin > > Clifford James wrote:Well guys, I fixed it for now with some ugly code, have a look at this: function updateDiv(page) { if(!Cookie.get(''flag'')) { Cookie.set(''flag'', ''flag'', 1); new Effect.BlindUp(''begin''); new Effect.Fade(''begin''); setTimeout("new Ajax.Updater(''begin'', ''/pages/"+page+"'', {onComplete:function(){new Effect.BlindDown(''begin''); new Effect.Appear(''begin'');}, asynchronous:true, evalScripts:true});", 1500); setTimeout("Cookie.erase(''flag'')",1501); } } On 16 mrt, 10:55, "Clifford James"<Clifford.Ja...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:Hiya there! I''m using This combo for reloading the page content; -Effect.BlindUp -Effect.Fade -Ajax.Updater -Effect.BlindDown -Effect.Appear All of this is handled as one function updateContent(); Now I use this function in a link (onclick="updateContent(''hereTheNewPage'');"). Now when I double click on a link with that function the BlindDown / BlindUp crashes. Its hard to explain but take a look at this demo site :http://cliffordjames.wobutidau.comIsthere a way to fix this? Thanks, Clifford James--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---