Ticket #6646: 6646_2.patch

File 6646_2.patch, 2.6 KB (added by Sa'ar Zac Elias, 13 years ago)
  • _source/core/dom/node.js

     
    679679                        {
    680680                                if ( current.type == CKEDITOR.NODE_ELEMENT )
    681681                                {
    682                                         if ( current.is( 'body' ) || current.getCustomData( '_cke_notReadOnly' ) )
     682                                        if ( current.is( 'body' ) || !!current.data( 'cke-editable' ) )
    683683                                                break;
    684684
    685685                                        if ( current.getAttribute( 'contentEditable' ) == 'false' )
  • _source/plugins/htmldataprocessor/plugin.js

     
    260260
    261261        function protectReadOnly( element )
    262262        {
    263                 element.attributes.contenteditable = "false";
     263                var attrs = element.attributes;
     264
     265                // We should flag that the element was locked by our code so
     266                // it'll be editable by the editor functions (#6046).
     267                if ( attrs.contenteditable != "false" )
     268                        attrs[ 'data-cke-editable' ] = attrs.contenteditable ? 'true' : 1;
     269
     270                attrs.contenteditable = "false";
    264271        }
    265272        function unprotectReadyOnly( element )
    266273        {
    267                 delete element.attributes.contenteditable;
     274                var attrs = element.attributes;
     275                switch( attrs[ 'data-cke-editable' ] )
     276                {
     277                        case 'true':    attrs.contenteditable = 'true'; break;
     278                        case '1':               delete attrs.contenteditable;   break;
     279                }
    268280        }
    269281        // Disable form elements editing mode provided by some browers. (#5746)
    270282        for ( i in { input : 1, textarea : 1 } )
  • _source/plugins/wysiwygarea/plugin.js

     
    11251125                                if ( element.type == CKEDITOR.NODE_ELEMENT
    11261126                                                && ( element.is( 'input' ) || element.is( 'textarea' ) ) )
    11271127                                {
     1128                                        // We should flag that the element was locked by our code so
     1129                                        // it'll be editable by the editor functions (#6046).
    11281130                                        if ( !element.isReadOnly() )
    1129                                         {
    1130                                                 element.setAttribute( 'contentEditable', false );
    1131                                                 // We should flag that the element was locked by our code so
    1132                                                 // it'll be editable by the editor functions (#6046).
    1133                                                 element.setCustomData( '_cke_notReadOnly', 1 );
    1134                                         }
     1131                                                element.data( 'cke-editable', element.hasAttribute( 'contenteditable' ) ? 'true' : '1' );
     1132                                        element.setAttribute( 'contentEditable', false );
    11351133                                }
    11361134                        });
    11371135
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy