Skip to content

Commit

Permalink
Disable escape key on rich text fields - fixes #2998
Browse files Browse the repository at this point in the history
  • Loading branch information
gasman committed Sep 16, 2016
1 parent 8aa316c commit c6666c6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Changelog
* Fix: Image rendition / document file deletion now happens on a post_delete signal, so that files are not lost if the deletion does not proceed (Janneke Janssen)
* Fix: "Your recent edits" list on dashboard no longer leaves out pages that another user has subsequently edited (Michael Cordover, Kees Hink, João Luiz Lorencetti)
* Fix: `InlinePanel` now accepts a `classname` parameter as per the documentation (emg36, Matt Westcott)
* Fix: Disabled use of escape key to revert content of rich text fields, which could cause accidental data loss (Matt Westcott)


1.6.2 (02.09.2016)
Expand Down
1 change: 1 addition & 0 deletions docs/releases/1.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Bug fixes
* Image rendition / document file deletion now happens on a post_delete signal, so that files are not lost if the deletion does not proceed (Janneke Janssen)
* "Your recent edits" list on dashboard no longer leaves out pages that another user has subsequently edited (Michael Cordover, Kees Hink, João Luiz Lorencetti)
* ``InlinePanel`` now accepts a ``classname`` parameter as per the documentation (emg36, Matt Westcott)
* Disabled use of escape key to revert content of rich text fields, which could cause accidental data loss (Matt Westcott)


Upgrade considerations
Expand Down
12 changes: 1 addition & 11 deletions wagtail/wagtailadmin/static_src/wagtailadmin/js/vendor/hallo.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,18 +307,8 @@
}
},
_keys: function(event) {
var old, widget;
var widget;
widget = event.data;
if (event.keyCode === 27) {
old = widget.getContents();
widget.restoreOriginalContent(event);
widget._trigger("restored", null, {
editable: widget,
content: widget.getContents(),
thrown: old
});
return widget.turnOff();
}
},
_rangesEqual: function(r1, r2) {
if (r1.startContainer !== r2.startContainer) {
Expand Down

0 comments on commit c6666c6

Please sign in to comment.