mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
refactoring to editable_text
This commit is contained in:
parent
d34d265d01
commit
3ccb1c6ac1
@ -56,7 +56,7 @@ import SimilarNotesWidget from "./widgets/similar_notes.js";
|
|||||||
import WhatLinksHereWidget from "./widgets/what_links_here.js";
|
import WhatLinksHereWidget from "./widgets/what_links_here.js";
|
||||||
import SidePaneToggles from "./widgets/side_pane_toggles.js";
|
import SidePaneToggles from "./widgets/side_pane_toggles.js";
|
||||||
import EmptyTypeWidget from "./widgets/type_widgets/empty.js";
|
import EmptyTypeWidget from "./widgets/type_widgets/empty.js";
|
||||||
import TextTypeWidget from "./widgets/type_widgets/text.js";
|
import TextTypeWidget from "./widgets/type_widgets/editable_text.js";
|
||||||
import CodeTypeWidget from "./widgets/type_widgets/code.js";
|
import CodeTypeWidget from "./widgets/type_widgets/code.js";
|
||||||
import FileTypeWidget from "./widgets/type_widgets/file.js";
|
import FileTypeWidget from "./widgets/type_widgets/file.js";
|
||||||
import ImageTypeWidget from "./widgets/type_widgets/image.js";
|
import ImageTypeWidget from "./widgets/type_widgets/image.js";
|
||||||
|
@ -5,7 +5,7 @@ import noteContentRenderer from "./services/note_content_renderer.js";
|
|||||||
import appContext from "./services/app_context.js";
|
import appContext from "./services/app_context.js";
|
||||||
import FlexContainer from "./widgets/flex_container.js";
|
import FlexContainer from "./widgets/flex_container.js";
|
||||||
import EmptyTypeWidget from "./widgets/type_widgets/empty.js";
|
import EmptyTypeWidget from "./widgets/type_widgets/empty.js";
|
||||||
import TextTypeWidget from "./widgets/type_widgets/text.js";
|
import TextTypeWidget from "./widgets/type_widgets/editable_text.js";
|
||||||
import CodeTypeWidget from "./widgets/type_widgets/code.js";
|
import CodeTypeWidget from "./widgets/type_widgets/code.js";
|
||||||
import FileTypeWidget from "./widgets/type_widgets/file.js";
|
import FileTypeWidget from "./widgets/type_widgets/file.js";
|
||||||
import ImageTypeWidget from "./widgets/type_widgets/image.js";
|
import ImageTypeWidget from "./widgets/type_widgets/image.js";
|
||||||
|
@ -5,7 +5,7 @@ import SpacedUpdate from "../services/spaced_update.js";
|
|||||||
import server from "../services/server.js";
|
import server from "../services/server.js";
|
||||||
import libraryLoader from "../services/library_loader.js";
|
import libraryLoader from "../services/library_loader.js";
|
||||||
import EmptyTypeWidget from "./type_widgets/empty.js";
|
import EmptyTypeWidget from "./type_widgets/empty.js";
|
||||||
import TextTypeWidget from "./type_widgets/text.js";
|
import EditableTextTypeWidget from "./type_widgets/editable_text.js";
|
||||||
import CodeTypeWidget from "./type_widgets/code.js";
|
import CodeTypeWidget from "./type_widgets/code.js";
|
||||||
import FileTypeWidget from "./type_widgets/file.js";
|
import FileTypeWidget from "./type_widgets/file.js";
|
||||||
import ImageTypeWidget from "./type_widgets/image.js";
|
import ImageTypeWidget from "./type_widgets/image.js";
|
||||||
@ -36,7 +36,7 @@ const TPL = `
|
|||||||
const typeWidgetClasses = {
|
const typeWidgetClasses = {
|
||||||
'empty': EmptyTypeWidget,
|
'empty': EmptyTypeWidget,
|
||||||
'deleted': DeletedTypeWidget,
|
'deleted': DeletedTypeWidget,
|
||||||
'text': TextTypeWidget,
|
'editable-text': EditableTextTypeWidget,
|
||||||
'read-only-text': ReadOnlyTextTypeWidget,
|
'read-only-text': ReadOnlyTextTypeWidget,
|
||||||
'code': CodeTypeWidget,
|
'code': CodeTypeWidget,
|
||||||
'file': FileTypeWidget,
|
'file': FileTypeWidget,
|
||||||
@ -187,6 +187,10 @@ export default class NoteDetailWidget extends TabAwareWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type === 'text') {
|
||||||
|
type = 'editable-text';
|
||||||
|
}
|
||||||
|
|
||||||
if (note.isProtected && !protectedSessionHolder.isProtectedSessionAvailable()) {
|
if (note.isProtected && !protectedSessionHolder.isProtectedSessionAvailable()) {
|
||||||
type = 'protected-session';
|
type = 'protected-session';
|
||||||
}
|
}
|
||||||
|
@ -78,8 +78,8 @@ const TPL = `
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default class TextTypeWidget extends TypeWidget {
|
export default class EditableTextTypeWidget extends TypeWidget {
|
||||||
static getType() { return "text"; }
|
static getType() { return "editable-text"; }
|
||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
Loading…
x
Reference in New Issue
Block a user