diff --git a/package-lock.json b/package-lock.json index 1b4d03f56..d8d275db6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "trilium", - "version": "0.33.5", + "version": "0.33.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2de58f05e..7a426889b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "trilium", "productName": "Trilium Notes", "description": "Trilium Notes", - "version": "0.33.5", + "version": "0.33.6", "license": "AGPL-3.0-only", "main": "electron.js", "bin": { diff --git a/src/public/javascripts/services/note_detail_code.js b/src/public/javascripts/services/note_detail_code.js index 1403d0711..8bde2b9a7 100644 --- a/src/public/javascripts/services/note_detail_code.js +++ b/src/public/javascripts/services/note_detail_code.js @@ -14,6 +14,7 @@ class NoteDetailCode { this.ctx = ctx; this.codeEditor = null; this.$component = ctx.$tabContent.find('.note-detail-code'); + this.$editorEl = this.$component.find('.note-detail-code-editor'); this.$executeScriptButton = ctx.$tabContent.find(".execute-script-button"); utils.bindElShortcut(ctx.$tabContent, "ctrl+return", () => this.executeCurrentNote()); @@ -34,7 +35,7 @@ class NoteDetailCode { CodeMirror.modeURL = 'libraries/codemirror/mode/%N/%N.js'; - this.codeEditor = CodeMirror(this.$component[0], { + this.codeEditor = CodeMirror(this.$editorEl[0], { value: "", viewportMargin: Infinity, indentUnit: 4, diff --git a/src/public/javascripts/services/tab_context.js b/src/public/javascripts/services/tab_context.js index 5e781a859..9eaf6a22c 100644 --- a/src/public/javascripts/services/tab_context.js +++ b/src/public/javascripts/services/tab_context.js @@ -83,7 +83,11 @@ class TabContext { if (utils.isDesktop()) { // keyboard plugin is not loaded in mobile - this.$noteTitle.bind('keydown', 'return', () => this.getComponent().focus()); + this.$noteTitle.bind('keydown', 'return', () => { + this.getComponent().focus(); + + return false; // to not propagate the enter into the editor (causes issues with codemirror) + }); } this.$protectButton = this.$tabContent.find(".protect-button"); diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css index d02a3345d..d1639dbbd 100644 --- a/src/public/stylesheets/style.css +++ b/src/public/stylesheets/style.css @@ -357,10 +357,13 @@ div.ui-tooltip { } .note-detail-code { - min-height: 200px; overflow: auto; } +.note-detail-code-editor { + min-height: 200px; +} + .note-detail-render { min-height: 200px; } diff --git a/src/services/build.js b/src/services/build.js index efca6b7b8..3984307ae 100644 --- a/src/services/build.js +++ b/src/services/build.js @@ -1 +1 @@ -module.exports = { buildDate:"2019-06-30T21:47:04+02:00", buildRevision: "af21dd4463afdb901a27a075228a4bdf4cd5ecb5" }; +module.exports = { buildDate:"2019-07-02T22:26:05+02:00", buildRevision: "196264b8c2fc626e3114d65423c7110cff99ae85" }; diff --git a/src/views/tabs.ejs b/src/views/tabs.ejs index 5f0c5560e..d8766f889 100644 --- a/src/views/tabs.ejs +++ b/src/views/tabs.ejs @@ -15,7 +15,9 @@ <div class="note-detail-text-editor" tabindex="10000"></div> </div> - <div class="note-detail-code note-detail-component"></div> + <div class="note-detail-code note-detail-component"> + <div class="note-detail-code-editor"></div> + </div> <% include details/empty.ejs %>