Ticket #6615: 6615_3.patch

File 6615_3.patch, 1.9 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/tableresize/plugin.js

     
    161161
    162162                var leftSideCells, rightSideCells, leftShiftBoundary, rightShiftBoundary;
    163163
     164                var savedRange;
     165                function toggleDesignMode( state )
     166                {
     167                        document.getBody().$.contentEditable = !!state;
     168                }
     169
    164170                function detach()
    165171                {
    166172                        pillar = null;
     
    171177                        resizer.removeListener( 'mousedown', onMouseDown );
    172178                        resizer.removeListener( 'mousemove', onMouseMove );
    173179
     180                        needsIEHacks && toggleDesignMode( 1 );
    174181                        document.getBody().setStyle( 'cursor', 'auto' );
    175182
    176183                        // Hide the resizer (remove it on IE7 - #5890).
     
    278285                {
    279286                        cancel( evt );
    280287
     288                        if ( needsIEHacks )
     289                        {
     290                                toggleDesignMode( 1 );
     291                                savedRange = document.$.selection.createRange();
     292                        }
     293
    281294                        resizeStart();
    282295
    283296                        document.on( 'mouseup', onMouseUp, this );
     
    288301                        evt.removeListener();
    289302
    290303                        resizeEnd();
     304
     305                        if ( needsIEHacks && savedRange )
     306                                setTimeout( function() { savedRange.select(); }, 0 );
     307
    291308                }
    292309
    293310                function onMouseMove( evt )
     
    331348                                });
    332349
    333350                        // In IE6/7, it's not possible to have custom cursors for floating
    334                         // elements in an editable document. Show the resizer in that case,
    335                         // to give the user a visual clue.
    336                         needsIEHacks && resizer.setOpacity( 0.25 );
     351                        // elements in an editable document.
     352                        needsIEHacks && toggleDesignMode();
    337353
    338354                        resizer.on( 'mousedown', onMouseDown, this );
    339355
     
    437453                                                }
    438454
    439455                                                var pillar = getPillarAtPosition( pillars, evt.$.clientX );
    440                                                 if ( pillar )
     456
     457                                                // Skip mouse drag/drop/selection.
     458                                                if ( pillar && !evt.$.button )
    441459                                                {
    442460                                                        !resizer && ( resizer = new columnResizer( editor ) );
    443461                                                        resizer.attachTo( pillar );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy