mediawiki.notification: Make notification area sticky to window
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 23 Jul 2013 23:15:12 +0000 (01:15 +0200)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 23 Jul 2013 23:38:42 +0000 (01:38 +0200)
commita4b62f1b8572651a3301f0809aa7a4efa5bfc1a3
tree48e52bf8eb6c4a61a87c63d3739cbc2dd05b636a
parent7627cf61759aca2bd8f7128c5d1141689d6769f5
mediawiki.notification: Make notification area sticky to window

Whenever the user scrolls beyond the natural offset (possibly
customised by the skin, e.g. in Vector it accounts for the
tabs and search bar, in Monobook it is relative to the content
area, etc.) we switch from absolute to fixed position.

Changed the 1em top/right padding to be actual padding instead
of part of the offset, as otherwise `window.scrollTop > offset.top`
would trigger too late and thus cause it to "jump" back about
13px (1em) whenever we switch (the scroll logic depends on the
floating-mode offset being 0).

Now it seemlessly switches between the two area modes.
Based on logic in VisualEditor for the sticky editor toolbar.

Using a class instead of an ID for the area element as otherwise
all selectors would require being like "#area.area-floating" to
work from the skin. This should've been the case from the
beginning (using IDs in CSS is almost always bad).

Falls back to absolute position in IE6, where 'fixed' is not
supported (and would use positon 'static' otherwise which would
be a problem).

Cleaned up useless 'null' value for $area variable.

Bug: 50870
Change-Id: Icb7cd68f48443c1770e3585c8567fea2ac16dad8
RELEASE-NOTES-1.22
resources/mediawiki/mediawiki.notification.css
resources/mediawiki/mediawiki.notification.js
skins/vector/screen.css