Skip to content

Commit 1ea0d28

Browse files
committed
fix text instance sometimes remaining displayed when switching to e.g. image
1 parent 6e3d847 commit 1ea0d28

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

src/public/javascripts/services/note_detail_image.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import utils from "./utils.js";
2-
import noteDetailService from "./note_detail.js";
32
import infoService from "./info.js";
43
import server from "./server.js";
54

src/public/javascripts/services/note_detail_text.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class NoteDetailText {
88
constructor(ctx) {
99
this.ctx = ctx;
1010
this.$component = ctx.$tabContent.find('.note-detail-text');
11+
this.$editorEl = this.$component.find('.note-detail-text-editor');
1112
this.textEditor = null;
1213

1314
this.$component.on("dblclick", "img", e => {
@@ -39,7 +40,7 @@ class NoteDetailText {
3940
// textEditor might have been initialized during previous await so checking again
4041
// looks like double initialization can freeze CKEditor pretty badly
4142
if (!this.textEditor) {
42-
this.textEditor = await BalloonEditor.create(this.$component[0], {
43+
this.textEditor = await BalloonEditor.create(this.$editorEl[0], {
4344
placeholder: "Type the content of your note here ..."
4445
});
4546

src/public/stylesheets/style.css

+6-3
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,16 @@ ul.fancytree-container {
135135
.note-detail-text h6 { font-size: 1.1em; }
136136

137137
.note-detail-text {
138+
overflow: auto;
139+
font-family: var(--detail-text-font-family);
140+
}
141+
142+
.note-detail-text-editor {
143+
padding-top: 10px;
138144
border: 0 !important;
139145
box-shadow: none !important;
140146
/* This is because with empty content height of editor is 0 and it's impossible to click into it */
141147
min-height: 200px;
142-
padding-top: 10px;
143-
overflow: auto;
144-
font-family: var(--detail-text-font-family);
145148
}
146149

147150
.note-detail-text p:first-child, .note-detail-text::before {

src/views/tabs.ejs

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
<table class="note-detail-promoted-attributes"></table>
1212

1313
<div class="note-detail-component-wrapper">
14-
<div class="note-detail-text note-detail-component" tabindex="10000"></div>
14+
<div class="note-detail-text note-detail-component" tabindex="10000">
15+
<div class="note-detail-text-editor"></div>
16+
</div>
1517

1618
<div class="note-detail-code note-detail-component"></div>
1719

0 commit comments

Comments
 (0)