react-epfl / gadget

A collection of OpenSocial gadgets. Some require "spaces" extension to be implemented.
5 stars 1 forks source link

Auto resizing does not work in Learning Analytics apps #254

Open sten opened 9 years ago

sten commented 9 years ago

The following learning analytics widgets do not properly resize to their requested height:

http://www.golabz.eu/apps/student-time-spent http://www.golabz.eu/apps/online-users-visualisation

I have tried it on Safari, Chrome and Firefox (Mac). @davidsandoz can you fix this?

davidsandoz commented 9 years ago

@sten The last version of the online users gadget (merged 2 days ago) seems to work better with resizing. For the time spent gadget, I have the issue only with Firefox. I'll try to fix it with the enhancement I'm currently working on: #250

davidsandoz commented 9 years ago

@sten After some more tests, it looks like the last version of the online users gadget doesn't always resize well. Although sometimes it does, which doesn't help much to determine if it is fixed or not. I'll have a look.

sten commented 9 years ago

From my personal experience with the notorious adjustHeight function, it is important not too call it too early and often. It is an expensive operation that involves RPC. So try to call it once you are sure about the size of the gadget and do not connect in on load on any resize event. maybe this helps.

davidsandoz commented 9 years ago

Thanks for the tips. A first solution that seems to work is simply wait for 5 seconds before calling adjustHeight. I suppose there can be a better solution. I'll try to find the best place to call it.

voz commented 9 years ago

@davidsandoz could you submit a fix with the delay, maybe you should put it onload?

voz commented 9 years ago

@davidsandoz We just have a session tomorrow, so if you have an opportunity to submit a quick fix, that would be great.