Skip to content

Commit

Permalink
Merge branch 't/9761'
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed May 22, 2013
2 parents beb5383 + 56df89a commit 3b38fe9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -4,6 +4,7 @@ CKEditor 4 Changelog
## CKEditor 4.1.2

* [#10389](http://dev.ckeditor.com/ticket/10389): Invalid closing tag </tr> in a sample "Text and Table" template.
* [#9761](http://dev.ckeditor.com/ticket/9761): Update BACKSPACE key state in blockedKeystrokes when using editor.setReadOnly().

## CKEditor 4.1.1

Expand Down
6 changes: 5 additions & 1 deletion core/editable.js
Expand Up @@ -432,7 +432,11 @@

// Setup editor keystroke handlers on this element.
var keystrokeHandler = editor.keystrokeHandler;
keystrokeHandler.blockedKeystrokes[ 8 ] = editor.readOnly;

// If editor is read-only, then make sure that BACKSPACE key
// is blocked to prevent browser history navigation.
keystrokeHandler.blockedKeystrokes[ 8 ] = +editor.readOnly;

editor.keystrokeHandler.attach( this );

// Update focus states.
Expand Down
4 changes: 4 additions & 0 deletions core/editor.js
Expand Up @@ -840,6 +840,10 @@
if ( this.readOnly != isReadOnly ) {
this.readOnly = isReadOnly;

// Block or release BACKSPACE key according to current read-only
// state to prevent browser's history navigation (#9761).
this.keystrokeHandler.blockedKeystrokes[ 8 ] = +isReadOnly;

this.editable().setReadOnly( isReadOnly );

// Fire the readOnly event so the editor features can update
Expand Down

0 comments on commit 3b38fe9

Please sign in to comment.