X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/65048f64d018c105be3921ca4bcb9f5183e2382e..c1ed3c489fb1dc4e433e394b68fcfd5ac4e49246:/project/static/js/codemirror/editor.js?ds=sidebyside diff --git a/project/static/js/codemirror/editor.js b/project/static/js/codemirror/editor.js index b8b7abc8..757d3eaf 100644 --- a/project/static/js/codemirror/editor.js +++ b/project/static/js/codemirror/editor.js @@ -656,7 +656,7 @@ var Editor = (function(){ // Intercept enter and tab, and assign their new functions. keyDown: function(event) { if (this.frozen == "leave") this.frozen = null; - if (this.frozen && (!this.keyFilter || this.keyFilter(event.keyCode))) { + if (this.frozen && (!this.keyFilter || this.keyFilter(event))) { event.stop(); this.frozen(event); return; @@ -734,7 +734,7 @@ var Editor = (function(){ // keydown event does not prevent the associated keypress event // from happening, so we have to cancel enter and tab again // here. - if ((this.frozen && (!this.keyFilter || this.keyFilter(event.keyCode))) || + if ((this.frozen && (!this.keyFilter || this.keyFilter(event))) || event.code == 13 || (event.code == 9 && this.options.tabMode != "default") || (event.keyCode == 32 && event.shiftKey && this.options.tabMode == "default")) event.stop();