I believe that the "document.onload" and the standard jQuery
$(function(){}) methods don't work correctly in wave due to the odd
loading ordrer.  Instead, use

function init() {
  if( typeof wave!='undefined' && wave.isInWaveContainer() ) {
    // do your wave-specific initialization here
  }
}
gadgets.util.registerOnLoadHandler(init);

On Mon, Nov 16, 2009 at 8:07 AM, qMax <[email protected]> wrote:
> Ok.
> I believe in magic.
> But this time i cannot figure out what exact magic is necessary.
>
> Here is minimal gadget, containing only debug log and printing state/
> mode/viewer/host at various stages:
> http://qmax.academ.org/wave/test.xml
>
> At start of onloadHandler there is:
>  if (wave === undefined || ! wave.isInWaveContainer()) {
>    alert('I wanna be in a wave!');
>    return;
>    }
>
> Here is instance of it:
> https://wave.google.com/a/wavesandbox.com/#restored:wave:wavesandbox.com!w%252BW80qIMN-A.4
>
> After gadget loaded it shows that state/viewer/host/mode are null (but
> not undefined).
>
> After gadget loaded, stateUpdated automatically triggered to setup the
> state.
> (Chrome 4.0.223.11, Firefox 3.5.3)
>
> What's wrong with it?
>
> On 16 ноя, 20:56, "\\x00" <[email protected]> wrote:
>> http://groups.google.com/group/google-wave-api/browse_thread/thread/f...
>>
>> I don't use
>>
>> Just put
>>
>>    if (typeof wave != 'undefined' && wave.isInWaveContainer()){
>>        wave.setStateCallback(stateUpdated);
>>        wave.getState()
>>        gadgets.window.adjustHeight();
>>     }
>>
>> at the end of my jquery document ready works fine
>>
>> On Nov 15, 7:50 pm, qMax <[email protected]> wrote:
>>
>>
>>
>> > Hi.
>>
>> > I discovered that gadget state is unavailable in onLoad handler,
>> > even if it exists in blip when wave is opened.
>> > The same for viewer and host.
>>
>> > Is it bug or feature?
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Google Wave API" 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/google-wave-api?hl=.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Google Wave API" 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/google-wave-api?hl=.


Reply via email to