Last modified: 2013-04-22 16:15:55 UTC
We often want to point guiders to elements such as save buttons (wpSave) and the like. However, in tours such as http://piramido.wmflabs.org/wiki/List_of_Google_Stuff?tour=gettingstarted the tooltip is off by quite a bit for save and preview, and slightly for edit. JS adding things like editing toolbars etc. may account for some shift in the placement of the associated elements after the tooltip is loaded.
Created attachment 11646 [details] Save
Created attachment 11647 [details] Preview
Created attachment 11648 [details] Edit
Ori suggested binding to resize or scroll. It looks like the height of the overall document changes, so resize might work.
There's actually already resize code in upstream (which isn't working for this reflow), so it's going to be a little more complicated: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/GuidedTour/guiders.git;a=blob;f=guiders-1.2.8.js;h=92c5f673bd3337a19bf1cf1b820d35d91db439b9;hb=refs/heads/master#l804
You need to fire on .ready(): $( function () { $( window ).trigger( 'resize' ); } );
Just to confirm: still seeing this error in latest version on piramido.
I tested Ori's patch, and it looks good so far: https://gerrit.wikimedia.org/r/#/c/45671/
Unfortunately, that didn't quite work. WikiEditor is using $.eachAsync (from jquery.async.js in core) to build the toolbar. That uses setTimeout internally, so even if our document.ready is registered after theirs, the toolbar setup could finish any time after. I've made a one-line Gerrit to WikiEditor (pending review) at https://gerrit.wikimedia.org/r/#/c/46490/ . It simply triggers an event to let other code know when it's done asynchronously building the initial toolbar sections (which shift the vertical layout). I have a Gerrit change to have GuidedTour listen to the new event (we should keep the document.ready in Guiders proper, for other situations). https://gerrit.wikimedia.org/r/#/c/46491/
Both merged. Until the change to WikiEditor is deployed, GuidedTour won't be get this signal/event. There won't be a runtime error either way, but it's still best we deploy WikiEditor with this change Thursday if possible.