Sounds like a good idea, although I think this could be handled by the programmer quite easily.

For example, override the insertion function with one that checks a counter before calling Element.update manually:
function doUpdate(what){
    if(!element.updateCounter){ element.updateCounter = 0; }
    element.updateCounter++;
    new Ajax.Updater(element,'page',{
        parameters: 'getData='+what,
        insertion: function(element,update){
            element.updateCounter--;
            if(element.updateCounter == 0){ Element.update(element,update); }
        }
    });
}

Note, this wouldn't prevent evalScripts from happening if it was enabled, or onComplete, etc.. from being called, so that would be a benefit to the patch if it handles these cases correctly.

Seeing some code would have been nice. :(
  
Agreed, we gotta see the code!
IMHO, there's no need for such an "override" parameter. Better yet, simply
twist Ajax.Updater to behave like this.
I'm not so sure.. Say your insertion is something besides Element.update. If it is Insertion.Bottom then you may not want any insertions overridden. Rather than having Prototype test which insertion you're using, the override parameter may be a simpler and cleaner solution. Let the programmer decide!

See http://prototypejs.org/contribute for info on submitting a patch.

Colin

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---




Reply via email to