Ticket #7914: 7914.patch

File 7914.patch, 2.2 KB (added by Frederico Caldeira Knabben, 13 years ago)
  • _samples/readonly.html

     
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    22<!--
    33Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
    44For licensing, see LICENSE.html or http://ckeditor.com/license
     
    7878                </p>
    7979                <p>
    8080                        <input id="readOnlyOn" onclick="toggleReadOnly();" type="button" value="Make it read-only" style="display:none" />
    81                         <input id="readOnlyOff" onclick="toggleReadOnly( true );" type="button" value="Make it editable again" style="display:none" />
     81                        <input id="readOnlyOff" onclick="toggleReadOnly( false );" type="button" value="Make it editable again" style="display:none" />
    8282                </p>
    8383        </form>
    8484        <div id="footer">
  • _source/core/editor.js

     
    733733                 * some editor features. This function sets the readOnly property of
    734734                 * the editor, firing the "readOnly" event.<br><br>
    735735                 * <strong>Note:</strong> the current editing area will be reloaded.
    736                  * @param {Boolean} [makeEditable] Indicates that the editor must be
    737                  *              restored from read-only mode, making it editable.
     736                 * @param {Boolean} [isReadOnly] Indicates that the editor must go
     737                 *              read-only (true, default) or be restored and made editable (false).
    738738                 * @since 3.6
    739739                 */
    740                 setReadOnly : function( makeEditable )
     740                setReadOnly : function( isReadOnly )
    741741                {
    742                         if ( this.readOnly != !makeEditable )
     742                        isReadOnly = ( isReadOnly == undefined ) || isReadOnly;
     743
     744                        if ( this.readOnly != isReadOnly )
    743745                        {
    744                                 this.readOnly = !makeEditable;
     746                                this.readOnly = isReadOnly;
    745747
    746748                                // Fire the readOnly event so the editor features can update
    747749                                // their state accordingly.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy