0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-01-03 05:00:13 -05:00

Added support for readOnly editor

This commit is contained in:
tHBp 2016-11-28 16:02:42 +05:30
parent d08aeca864
commit a7ab016236
2 changed files with 3 additions and 2 deletions

View file

@ -62,7 +62,8 @@ pass a set of attributes to apply to each default block:
var editor = new Squire( document, {
blockTag: 'P',
blockAttributes: { style: 'font-size: 16px;' }
blockAttributes: { style: 'font-size: 16px;' },
readOnly: false // default is true
})
If using the simple setup, call `editor.setConfig(…);` with your

View file

@ -146,7 +146,7 @@ function Squire ( root, config ) {
};
}
root.setAttribute( 'contenteditable', 'true' );
root.setAttribute( 'contenteditable', !(config.readOnly || false) );
// Remove Firefox's built-in controls
try {