Last modified: 2014-10-27 00:17:39 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 T41874, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39874 - Live preview should not scroll (or there should be an option to disable the scrolling)
Live preview should not scroll (or there should be an option to disable the s...
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.21.x
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: javascript
Depends on:
Blocks: 39272
  Show dependency treegraph
 
Reported: 2012-09-01 00:54 UTC by Helder
Modified: 2014-10-27 00:17 UTC (History)
4 users (show)

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


Attachments

Description Helder 2012-09-01 00:54:56 UTC
The recent gerrit change I743ed45e (which fixed bug 25830) reminded me that the "ajaxPreviewScrollTop" option from
https://en.wikipedia.org/wiki/User:Js/ajaxPreview
is very useful, because using it we can avoid unnecessary scrolling when using the preview button several times during an edit (e.g. while typing a long math formula).

Please provide a similar option for the default live preview from MW.
Comment 1 Bartosz Dziewoński 2012-09-01 09:53:06 UTC
How do you think this should be implemented? As another checkbox in Preferences (which are already overcrowded), as a button around the edit form (which is overcrowded as well), or as a hidden option one can change in common.js? I can't say I like any of these options... :)
Comment 2 Krinkle 2012-09-02 20:05:31 UTC
This is not the kind of thing that should be an option in usable software. It is either found to be an improvement or not.

Also, if I understand correctly I743ed45e implements this as the default behavior. Assuming I misunderstood, what is the request here?
Comment 3 Krinkle 2012-09-02 20:08:03 UTC
This "ajaxPreviewScrollTop" option of the linked script[1], does:

> if (window.ajaxPreviewScrollTop) wkPreview[0].scrollIntoView()

Change I743ed45e:
> $wikiPreview[0].scrollIntoView();


[1] 
https://en.wikipedia.org/wiki/User:Js/ajaxPreview
https://en.wikipedia.org/wiki/User:Js/ajaxPreview.js
Comment 4 Krinkle 2012-09-02 20:09:36 UTC
Okay, summary has been improved. The request is to have a way to disable the automatic scroll towards the preview area.

Can you provide a use case for that? Why would a user not want to see the preview after clicking the button to generate that very preview?
Comment 5 Bartosz Dziewoński 2012-09-02 20:22:37 UTC
Maybe writing a long article, and previewing to see if what you just wrote at the end works correctly? 

I think that scrolling should be the default, though.
Comment 6 Krinkle 2012-09-02 20:46:36 UTC
That is a per-article (or rather, per-edit attempt) use case. That doesn't make it less valid, it is a perfect use case. But that does mean we should keep in mind that if and when we implement an option for it that it not be in the user preferences. Because I think in most cases it should scroll.

Also, there is a usability problem when not scrolling to the top because when altering anything other than the bottom of the article, it appears nothing happens when one clicks "Show preview". The scrolling to the top (and appearance of the spinner and fading also help) indicate that something happened and that it finished happening.
Comment 7 Helder 2012-09-02 21:01:45 UTC
Most of the time the content I'm editing is in the end of the page or section, so it is handy to be able to see both the previewed text and the edit box so that I can see the result of my changes. This is even more useful when I'm editing articles related to math, where I would add LaTeX formulas.

Maybe this could be implemented by means of hook (bug 23580?) or the code 
$wikiPreview[0].scrollIntoView();
could be moved to a function publicly accessible so that users could redefine it to a dummy "function(){}" (instead of copying the whole "window.doLivePreview").

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


Navigation
Links