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:
parent
d08aeca864
commit
a7ab016236
2 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue