diff options
| author | Christophe Matthieu <chm@odoo.com> | 2015-05-28 10:21:46 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2015-07-10 17:00:14 +0200 |
| commit | 0333941b5f76aa6337400cb332cc6085e57b0c43 (patch) | |
| tree | 2347d461634685e39eefd7197cea026ce1ef95ca /addons/web_editor/static/lib/summernote/src/js | |
| parent | ff58a961e8fa5adc38dfdb3045790f6203b57b46 (diff) | |
[FIX] web_editor: summernote: with firefox error to record an undo for the normal instance of the editor because global variable 'event' does not exists.
Diffstat (limited to 'addons/web_editor/static/lib/summernote/src/js')
| -rw-r--r-- | addons/web_editor/static/lib/summernote/src/js/editing/History.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/web_editor/static/lib/summernote/src/js/editing/History.js b/addons/web_editor/static/lib/summernote/src/js/editing/History.js index 5a3bb4dd176..89834d52cb1 100644 --- a/addons/web_editor/static/lib/summernote/src/js/editing/History.js +++ b/addons/web_editor/static/lib/summernote/src/js/editing/History.js @@ -54,8 +54,9 @@ define(['summernote/core/range', 'summernote/core/dom'], function (range, dom) { var last; this.recordUndo = function () { - var key = event; - if (event && !event.metaKey && !event.ctrlKey && !event.altKey && event.type === "keydown") { + // test event for firefox: remove stack of history because event doesn't exists + var key = typeof event !== 'undefined' ? event : false; + if (key && !event.metaKey && !event.ctrlKey && !event.altKey && event.type === "keydown") { key = event.type + "-"; if (event.which === 8 || event.which === 46) key += 'delete'; else if (event.which === 13) key += 'enter'; |
