Ticket #19845: 19845.5.diff
File 19845.5.diff, 4.4 KB (added by , 11 years ago) |
---|
-
src/wp-includes/js/media-views.js
2806 2806 tagName: 'div', 2807 2807 className: 'uploader-editor', 2808 2808 template: media.template( 'uploader-editor' ), 2809 _localDrag: false, 2809 2810 2810 2811 initialize: function() { 2812 var self = this; 2813 2811 2814 this.$document = $(document); 2812 2815 this.dropzones = []; 2813 2816 this.files = []; … … 2819 2822 this.$document.on( 'dragover', _.bind( this.containerDragover, this ) ); 2820 2823 this.$document.on( 'dragleave', _.bind( this.containerDragleave, this ) ); 2821 2824 2825 this.$document.on( 'dragstart', function() { 2826 self._localDrag = true; 2827 }); 2828 2829 this.$document.on( 'dragend', function() { 2830 self._localDrag = false; 2831 }); 2832 2822 2833 return this; 2823 2834 }, 2824 2835 … … 2887 2898 }, 2888 2899 2889 2900 containerDragover: function() { 2890 this.overContainer = true; 2891 this.refresh(); 2901 if ( ! this._localDrag ) { 2902 this.overContainer = true; 2903 this.refresh(); 2904 } 2892 2905 }, 2893 2906 2894 2907 containerDragleave: function() { … … 2899 2912 }, 2900 2913 2901 2914 dropzoneDragover: function( e ) { 2902 $( e.target ).addClass( 'droppable' ); 2903 this.overDropzone = true; 2904 _.defer( _.bind( this.refresh, this ) ); 2905 return false; 2915 if ( ! this._localDrag ) { 2916 $( e.target ).addClass( 'droppable' ); 2917 this.overDropzone = true; 2918 _.defer( _.bind( this.refresh, this ) ); 2919 return false; 2920 } 2906 2921 }, 2907 2922 2908 2923 dropzoneDragleave: function( e ) { -
src/wp-includes/js/tinymce/plugins/wordpress/plugin.js
1 /* global tinymce, getUserSetting, setUserSetting , switchEditors*/1 /* global tinymce, getUserSetting, setUserSetting */ 2 2 tinymce.PluginManager.add( 'wordpress', function( editor ) { 3 3 var DOM = tinymce.DOM, wpAdvButton, modKey, style, 4 4 last = 0; … … 276 276 }); 277 277 278 278 editor.on( 'init', function() { 279 var env = tinymce.Env, topx, reset, 279 var env = tinymce.Env, topx, reset, localDrag, 280 280 deltax = 0, 281 281 bodyClass = ['mceContentBody'], // back-compat for themes that use this in editor-style.css... 282 doc = editor.getDoc(); 282 doc = editor.getDoc(), 283 dom = editor.dom; 283 284 284 285 if ( editor.getParam( 'directionality' ) === 'rtl' ) { 285 286 bodyClass.push('rtl'); … … 299 300 300 301 tinymce.each( bodyClass, function( cls ) { 301 302 if ( cls ) { 302 editor.dom.addClass( doc.body, cls );303 dom.addClass( doc.body, cls ); 303 304 } 304 305 }); 305 306 … … 318 319 319 320 if ( ! ( 'ontouchstart' in window ) ) { 320 321 // When scrolling with mouse wheel or trackpad inside the editor, don't scroll the parent window 321 editor.dom.bind( doc, 'onwheel' in doc ? 'wheel' : 'mousewheel', function( event ) {322 dom.bind( doc, 'onwheel' in doc ? 'wheel' : 'mousewheel', function( event ) { 322 323 var delta, top, 323 324 docElement = doc.documentElement; 324 325 … … 370 371 event.preventDefault(); 371 372 }); 372 373 } 374 375 dom.bind( doc, 'dragstart', function() { 376 localDrag = true; 377 }); 378 379 dom.bind( doc, 'dragend', function() { 380 localDrag = false; 381 }); 382 383 dom.bind( doc, 'dragover', function( event ) { 384 if ( ! localDrag && typeof window.jQuery !== 'undefined' ) { 385 // Propagate the event to its container for the parent window to catch. 386 window.jQuery( editor.getContainer() ).trigger( event ); 387 } 388 }); 373 389 }); 374 390 375 391 // Word count … … 399 415 // Keep empty paragraphs :( 400 416 e.content = e.content.replace( /<p>(<br ?\/?>|\u00a0|\uFEFF)?<\/p>/g, '<p> </p>' ); 401 417 402 if ( editor.getParam( 'wpautop', true ) && typeof switchEditors !== 'undefined' ) {403 e.content = switchEditors.pre_wpautop( e.content );418 if ( editor.getParam( 'wpautop', true ) && typeof window.switchEditors !== 'undefined' ) { 419 e.content = window.switchEditors.pre_wpautop( e.content ); 404 420 } 405 421 }); 406 422 … … 443 459 editor.dom.bind( editor.getBody(), 'dragstart', function() { 444 460 _hideButtons(); 445 461 }); 446 447 editor.dom.bind( editor.getWin(), 'dragover', function(e) {448 if ( typeof window.jQuery !== 'undefined' ) {449 // Propagate the event to its container for the parent window to catch.450 jQuery( editor.getContainer() ).trigger(e);451 }452 });453 462 }); 454 463 455 464 editor.on( 'BeforeExecCommand', function() {