Changeset 27095
- Timestamp:
- 02/05/2014 01:09:42 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js
r27085 r27095 279 279 var env = tinymce.Env, 280 280 bodyClass = ['mceContentBody'], // back-compat for themes that use this in editor-style.css... 281 body = editor.getBody();281 doc = editor.getDoc(); 282 282 283 283 if ( editor.getParam( 'directionality' ) === 'rtl' ) { … … 299 299 tinymce.each( bodyClass, function( cls ) { 300 300 if ( cls ) { 301 editor.dom.addClass( body, cls );301 editor.dom.addClass( doc.body, cls ); 302 302 } 303 303 }); … … 315 315 window.jQuery( document ).triggerHandler( 'tinymce-editor-init', [editor] ); 316 316 } 317 318 // When scrolling with mouse wheel or trackpad inside the editor, don't scroll the parent window 319 editor.dom.bind( doc, 'onwheel' in doc ? 'wheel' : 'mousewheel', function( event ) { 320 var delta, docElement = doc.documentElement; 321 322 if ( editor.settings.wp_fullscreen || 'ontouchstart' in window ) { 323 return; 324 } 325 326 if ( typeof event.deltaY !== 'undefined' ) { 327 delta = event.deltaY; 328 329 if ( typeof event.deltaMode !== 'undefined' && event.deltaMode === event.DOM_DELTA_LINE ) { 330 delta *= 20; 331 } 332 } else { 333 delta = -event.wheelDelta; 334 } 335 336 // Reverse direction for MacOS 337 if ( env.mac ) { 338 delta *= -1; 339 } 340 341 event.preventDefault(); 342 343 if ( ( docElement.scrollTop === 0 && delta < 0 ) || 344 ( docElement.clientHeight + docElement.scrollTop === docElement.scrollHeight && delta > 0 ) ) { 345 346 return; 347 } 348 349 if ( env.webkit ) { 350 doc.body.scrollTop += delta; 351 } else { 352 docElement.scrollTop += delta; 353 } 354 }); 317 355 }); 318 356
Note: See TracChangeset
for help on using the changeset viewer.