Remove containment of scrolling inside the editor for now. See #27013

Built from https://develop.svn.wordpress.org/trunk@27770


git-svn-id: http://core.svn.wordpress.org/trunk@27607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-03-27 02:35:14 +00:00
parent f9964e361c
commit 15549e75f3
5 changed files with 2 additions and 108 deletions

View File

@ -1068,55 +1068,4 @@ jQuery(document).ready( function($) {
}
});
}
if ( ! ( 'ontouchstart' in window ) ) {
// When scrolling with mouse wheel or trackpad inside the Text editor, don't scroll the whole window
$content = $('#content').on( 'onwheel' in $document[0] ? 'wheel.text-editor-scroll' : 'mousewheel.text-editor-scroll', function( event ) {
var delta, top,
origEvent = event.originalEvent;
if ( wp.editor && wp.editor.fullscreen.settings.visible ) {
return;
}
// Don't modify scrolling when the Text editor is not active.
if ( document.activeElement && document.activeElement.id !== 'content' ) {
return;
}
if ( typeof origEvent.deltaY !== 'undefined' ) {
delta = origEvent.deltaY;
if ( typeof origEvent.deltaMode !== 'undefined' && origEvent.deltaMode === origEvent.DOM_DELTA_LINE ) {
delta *= 20;
}
} else {
delta = -origEvent.wheelDelta;
}
$content.scrollTop( $content.scrollTop() + delta );
top = $content.scrollTop();
if ( topx === top ) {
deltax += delta;
window.clearTimeout( reset );
reset = window.setTimeout( function() {
deltax = 0;
}, 1000 );
} else {
deltax = 0;
}
topx = top;
// Sensitivity: scroll the parent window when over-scrolling by more than 800px
if ( deltax > 1000 || deltax < -1000 ) {
return;
}
event.preventDefault();
});
}
});

File diff suppressed because one or more lines are too long

View File

@ -311,61 +311,6 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
window.jQuery( document ).triggerHandler( 'tinymce-editor-init', [editor] );
}
if ( ! ( 'ontouchstart' in window ) ) {
// When scrolling with mouse wheel or trackpad inside the editor, don't scroll the parent window
dom.bind( doc, 'onwheel' in doc ? 'wheel' : 'mousewheel', function( event ) {
var delta, top,
docElement = doc.documentElement;
if ( editor.settings.wp_fullscreen ) {
return;
}
// Don't modify scrolling when the editor is not active.
if ( typeof doc.hasFocus === 'function' && ! doc.hasFocus() ) {
return;
}
if ( typeof event.deltaY !== 'undefined' ) {
delta = event.deltaY;
if ( typeof event.deltaMode !== 'undefined' && event.deltaMode === event.DOM_DELTA_LINE ) {
delta *= 20;
}
} else {
delta = -event.wheelDelta;
}
if ( env.webkit ) {
doc.body.scrollTop += delta;
} else {
docElement.scrollTop += delta;
}
top = docElement.scrollTop || doc.body.scrollTop;
if ( topx === top ) {
deltax += delta;
window.clearTimeout( reset );
// Sensitivity: delay before resetting the count of over-scroll pixels
reset = window.setTimeout( function() {
deltax = 0;
}, 1000 );
} else {
deltax = 0;
}
topx = top;
// Sensitivity: scroll the parent window when over-scrolling by more than 1000px
if ( deltax > 1000 || deltax < -1000 ) {
return;
}
event.preventDefault();
});
}
dom.bind( doc, 'dragstart dragend dragover drop', function( event ) {
if ( typeof window.jQuery !== 'undefined' ) {
// Trigger the jQuery handlers.

File diff suppressed because one or more lines are too long