DFW: scroll to top when opening so the user is not disoriented, see #17136

git-svn-id: https://develop.svn.wordpress.org/trunk@17913 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2011-05-13 06:27:49 +00:00
parent a47c669b53
commit e2738c27c7
3 changed files with 5 additions and 8 deletions

View File

@ -276,8 +276,7 @@ PubSub.prototype.publish = function( topic, args ) {
});
ps.subscribe( 'showing', function() { // This event occurs while the DFW overlay blocks the UI.
var scrollY = s.mode === 'html' ? 220 + s._edCanvas.scrollTop : 140 + tinyMCE.get(s.editor_id).getBody().scrollTop;
$( document.body ).addClass( 'fullscreen-active' );
api.refresh_buttons();
@ -287,10 +286,8 @@ PubSub.prototype.publish = function( topic, args ) {
api.bind_resize();
setTimeout( api.resize_textarea, 200 );
if ( scrollY < 171 )
scrollY = 0;
scrollTo(0, scrollY);
// scroll to top so the user is not disoriented
scrollTo(0, 0);
});
ps.subscribe( 'shown', function() { // This event occurs after the DFW overlay is shown

File diff suppressed because one or more lines are too long

View File

@ -96,7 +96,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array('utils','jquery'), '20110411' );
$scripts->add_data( 'editor', 'group', 1 );
$scripts->add( 'wp-fullscreen', "/wp-admin/js/wp-fullscreen$suffix.js", array('jquery'), '20110511' );
$scripts->add( 'wp-fullscreen', "/wp-admin/js/wp-fullscreen$suffix.js", array('jquery'), '20110512' );
$scripts->add_data( 'wp-fullscreen', 'group', 1 );
$scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6.1');