Ticket #7914: 7914.patch
File 7914.patch, 2.2 KB (added by , 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"> 2 2 <!-- 3 3 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. 4 4 For licensing, see LICENSE.html or http://ckeditor.com/license … … 78 78 </p> 79 79 <p> 80 80 <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" /> 82 82 </p> 83 83 </form> 84 84 <div id="footer"> -
_source/core/editor.js
733 733 * some editor features. This function sets the readOnly property of 734 734 * the editor, firing the "readOnly" event.<br><br> 735 735 * <strong>Note:</strong> the current editing area will be reloaded. 736 * @param {Boolean} [ makeEditable] Indicates that the editor must be737 * re stored 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). 738 738 * @since 3.6 739 739 */ 740 setReadOnly : function( makeEditable)740 setReadOnly : function( isReadOnly ) 741 741 { 742 if ( this.readOnly != !makeEditable ) 742 isReadOnly = ( isReadOnly == undefined ) || isReadOnly; 743 744 if ( this.readOnly != isReadOnly ) 743 745 { 744 this.readOnly = !makeEditable;746 this.readOnly = isReadOnly; 745 747 746 748 // Fire the readOnly event so the editor features can update 747 749 // their state accordingly.