Ticket #9097: 9097.patch

File 9097.patch, 3.3 KB (added by Garry Yao, 12 years ago)
  • _source/plugins/selection/plugin.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    408408                                                                saveSelection();
    409409                                                        });
    410410
    411                                                 // When content doc is in standards mode, IE doesn't focus the editor when
    412                                                 // clicking at the region below body (on html element) content, we emulate
    413                                                 // the normal behavior on old IEs. (#1659, #7932)
    414                                                 if ( ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat )
    415                                                          && doc.$.compatMode != 'BackCompat' )
     411                                                // When content doc is in standards mode, IE doesn't produce text selection
     412                                                // when click on the region outside of body, we emulate
     413                                                // the correct behavior here. (#1659, #7932, # 9097)
     414                                                if ( CKEDITOR.env.ie && doc.$.compatMode != 'BackCompat' )
    416415                                                {
    417416                                                        function moveRangeToPoint( range, x, y )
    418417                                                        {
     
    449448
    450449                                                                // We're sure that the click happens at the region
    451450                                                                // below body, but not on scrollbar.
    452                                                                 if ( evt.y < html.$.clientHeight
    453                                                                          && evt.y > body.$.offsetTop + body.$.clientHeight
    454                                                                          && evt.x < html.$.clientWidth )
     451                                                                var el = CKEDITOR.dom.element.get( doc.$.elementFromPoint( evt.x, evt.y ) );
     452                                                                if ( el && el.is( 'html' ) )
    455453                                                                {
    456454                                                                        // Start to build the text range.
    457455                                                                        var textRng = body.$.createTextRange();
     
    467465                                                                                // Make it in effect on mouse up. (#9022)
    468466                                                                                textRng.select();
    469467                                                                        } );
    470                                                                 }
    471                                                         });
    472                                                 }
    473 
    474                                                 // It's much simpler for IE8, we just need to reselect the reported range.
    475                                                 if ( CKEDITOR.env.ie8 )
    476                                                 {
    477                                                         html.on( 'mouseup', function( evt )
    478                                                         {
    479                                                                 // The event is not fired when clicking on the scrollbars,
    480                                                                 // so we can safely check the following to understand
    481                                                                 // whether the empty space following <body> has been clicked.
    482                                                                 if ( evt.data.getTarget().getName() == 'html' )
    483                                                                 {
    484                                                                         var sel = CKEDITOR.document.$.selection,
    485                                                                                 range = sel.createRange();
    486                                                                         // The selection range is reported on host, but actually it should applies to the content doc.
    487                                                                         if ( sel.type != 'None' && range.parentElement().ownerDocument == doc.$ )
    488                                                                                 range.select();
    489468                                                                }
    490                                                         } );
     469                                                        });
    491470                                                }
    492471
    493472                                                // IE is the only to provide the "selectionchange"
  • _source/plugins/wysiwygarea/plugin.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    12671267                                editor.addCss( 'html { height: 100% !important; }' );
    12681268                                editor.addCss( 'img:-moz-broken { -moz-force-broken-image-icon : 1;     min-width : 24px; min-height : 24px; }' );
    12691269                        }
    1270                         // Remove the margin to avoid mouse confusion. (#8835)
    1271                         else if ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 && editor.config.contentsLangDirection == 'ltr' )
    1272                                 editor.addCss( 'body{margin-right:0;}' );
    12731270
    12741271                        /* #3658: [IE6] Editor document has horizontal scrollbar on long lines
    12751272                        To prevent this misbehavior, we show the scrollbar always */
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy