Hi,

I'm using Form.Request, and just discovered that it can do that nifty
spinner thing.  It wasn't working for me initially because I didn't
have the proper spinner styles or the graphic.  So I grabbed those,
and it's basically working, but now I'm having a problem with
spinnerTarget.

According to the docs, I should be able to pass in an element or id of
an element to "spinnerTarget", and during the submit, that given
element should be where the spinner is applied.  In practice, that
doesn't seem to be the case.  My call looks like this:

sessionsubmit: function (id, container) {
        if($(id)) {
                var gsubmit = new Form.Request(
                        id,
                        container,
                        {spinnerTarget: container}
                )
        }
}

If I do console.log() on "container" or even $(container), the code
finds it, so I know it's there.  However, it would appear that the
underlying Mootools code is hardwired to have the spinner appear on
the form (in my case 'id').  Here's what I think is the relevant code:

                makeRequest: function(){
                        this.request = new Request.HTML($merge({
                                        url: this.element.get('action'),
                                        update: this.update,
                                        emulation: false,
                                        spinnerTarget: this.element,
                                        method: this.element.get('method') || 
'post'
                        }, this.options.requestOptions)).addEvents({
                                success: function(text, xml){
                                        ['success', 
'complete'].each(function(evt){
                                                this.fireEvent(evt, 
[this.update, text, xml]);
                                        }, this);
                                }.bind(this),
                                failure: function(xhr){
                                        this.fireEvent('failure', xhr);
                                }.bind(this),
                                exception: function(){
                                        this.fireEvent('failure', xhr);
                                }.bind(this)
                        });
                },

It would appear that "spinnerTarget" is hardwired to the ID of the
form being submitted.  Maybe I'm missing something...

Thanks for any guidance.

Reply via email to