Last modified: 2013-10-08 17:46:14 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T52870, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 50870 - mediawiki.notification: Notification area should remain visible when scrolled down
mediawiki.notification: Notification area should remain visible when scrolled...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.22.0
All All
: Normal enhancement (vote)
: 1.22.0 release
Assigned To: Krinkle
:
: 48689 51432 (view as bug list)
Depends on:
Blocks: 49820
  Show dependency treegraph
 
Reported: 2013-07-06 21:02 UTC by Rainer Rillke @commons.wikimedia
Modified: 2013-10-08 17:46 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Rainer Rillke @commons.wikimedia 2013-07-06 21:02:18 UTC
Original bug title:
mediawiki.notification should show the notification bubble relative to the screen, not to the document

Current behaviour:
Calling mw.notify("abc") in JavaScript creates a message-bubble somewhere below the first <h1> heading (the title) and the bubble disappears after about 5s.

Why this is an issue:
But if you have scrolled-down the page, the notification disappears without being read.

Where is this an issue:
For example, when marking large new pages as patrolled, the patrol link is at the bottom of the page and the message whether patrolling succeeded is not visible to the user. Or at custom gadgets/user scripts.

Expected behaviour:
Bubble shown, no matter of the current scroll position.

Possible implementation:
Fixed position.
Comment 1 Gerrit Notification Bot 2013-07-06 21:53:10 UTC
Change 72322 had a related patch set uploaded by Matmarex:
mediawiki.notification: Show the notifications relative to the screen

https://gerrit.wikimedia.org/r/72322
Comment 2 Bartosz Dziewoński 2013-07-06 21:53:35 UTC
Heh, I though they behave in this way. Seems like an obvious enhancement.
Comment 3 Rainer Rillke @commons.wikimedia 2013-07-08 10:59:14 UTC
>Argh, I forgot that position:fixed is always relative to the entire document, >not to any positioned ancestor.
This is only true if you set top,left,right or bottom, AFAIK. Look at [[:commons:Special:Permalink/99667607]] (the grey DIV 2 inner is fixed)

See also http://stackoverflow.com/questions/8712047/positionfixed-when-left-top-right-bottom-arent-specified-desired-results-in

If one still wants to use something fancier (and one will have to for safari, unfortunately), one may use jQuery:
offset ( http://api.jquery.com/offset/ ) -- "Get the current coordinates of the first element in the set of matched elements, relative to the document."
This way one can get the position of mw.util.$content and add 1em. Here is an example implementation (one has to execute the positioning code every time the message is shown or one has to catch window.resize events).

var $content = mw.util.$content,
    $container = $('<div>').appendTo($content)
    $n = $('<div>').text('Message here').css({
     'float': 'right', // Set this in CSS so Janus can flip!
     'margin':  '1em'
    }).appendTo($container),
    o = $content.offset();
    
$container.css({
    position: 'fixed',
    width: $content.width()
}).offset(o);

Feel free to improve (padding of mw.util.$content is not respected) and note that styles are also touched in skin files like skins/vector/screen.css ( https://git.wikimedia.org/blob/mediawiki%2Fcore.git/9cbd77868a92022170348504fb5444e4e1f302fa/skins%2Fvector%2Fscreen.css#L807 )
Comment 4 Bartosz Dziewoński 2013-07-16 13:42:57 UTC
*** Bug 51432 has been marked as a duplicate of this bug. ***
Comment 5 Gerrit Notification Bot 2013-07-16 13:46:54 UTC
Change 73948 had a related patch set uploaded by Helder.wiki:
Use fixed position for notifications

https://gerrit.wikimedia.org/r/73948
Comment 6 Gerrit Notification Bot 2013-07-16 14:16:59 UTC
Change 73948 abandoned by Krinkle:
Use fixed position for notifications

Reason:
Dupe of Icb7cd68f484 (which has existed longer)

https://gerrit.wikimedia.org/r/73948
Comment 7 Bartosz Dziewoński 2013-07-21 23:32:00 UTC
*** Bug 51785 has been marked as a duplicate of this bug. ***
Comment 8 Gerrit Notification Bot 2013-07-24 03:27:06 UTC
Change 72322 merged by jenkins-bot:
mediawiki.notification: Make notification area sticky to window

https://gerrit.wikimedia.org/r/72322
Comment 9 James Forrester 2013-07-24 03:28:34 UTC
Fixed in the above patch, which we will deploy tomorrow as a cherry-pick given the need to fix this urgently for VisualEditor.
Comment 10 Gerrit Notification Bot 2013-07-24 15:09:00 UTC
Change 75611 had a related patch set uploaded by Catrope:
mediawiki.notification: Make notification area sticky to window

https://gerrit.wikimedia.org/r/75611
Comment 11 Gerrit Notification Bot 2013-07-24 15:12:31 UTC
Change 75614 had a related patch set uploaded by Catrope:
mediawiki.notification: Make notification area sticky to window

https://gerrit.wikimedia.org/r/75614
Comment 12 Gerrit Notification Bot 2013-07-24 15:28:19 UTC
Change 75611 merged by Catrope:
mediawiki.notification: Make notification area sticky to window

https://gerrit.wikimedia.org/r/75611
Comment 13 Gerrit Notification Bot 2013-07-24 15:30:19 UTC
Change 75614 merged by Catrope:
mediawiki.notification: Make notification area sticky to window

https://gerrit.wikimedia.org/r/75614
Comment 14 se4598 2013-07-24 17:39:11 UTC
above change deployed recently doesn't work for me; breaks UI:
* notification doesn't scroll with
* blocks user bar and other tabs in the top right corner
* css style changed

experienced in firefox 22 as well in chrome
Comment 15 Bartosz Dziewoński 2013-07-24 18:05:38 UTC
@se4598, thanks for the report, I7444bf55 should fix this. Sorry!
Comment 16 Gerrit Notification Bot 2013-07-24 18:06:10 UTC
Change 75662 had a related patch set uploaded by Matmarex:
mw.notification: Fix incorrect initial offset

https://gerrit.wikimedia.org/r/75662
Comment 17 Bartosz Dziewoński 2013-10-08 17:46:14 UTC
*** Bug 48689 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links