Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
display note type only for non-search notes
azivnerdb514e8f41a4
diff --git a/src/public/javascripts/note_type.js b/src/public/javascripts/note_type.jsindex d29afbf02d..54393b1306 100644--- a/src/public/javascripts/note_type.js+++ b/src/public/javascripts/note_type.js@@ -63,15 +63,15 @@ const noteType = (function() {return found ? found.title : mime;}}- else if (type === 'search') {- return 'Saved search';- }else if (type === 'render') {return 'Render HTML note';}else if (type === 'file') {return 'Attachment';}+ else if (type === 'search') {+ // ignore and do nothing, "type" will be hidden since it's not possible to switch to and from search+ }else {throwError('Unrecognized type: ' + type);}@@ -103,13 +103,6 @@ const noteType = (function() {save();};- this.selectSavedSearch = function() {- self.type('search');- self.mime('');-- save();- };-this.selectRender = function() {self.type('render');self.mime('');diff --git a/src/views/index.ejs b/src/views/index.ejsindex be19acc146..226f4b0591 100644--- a/src/views/index.ejs+++ b/src/views/index.ejs@@ -98,7 +98,7 @@id="execute-script-button"onclick="noteEditor.executeCurrentNote()">Execute <kbd>Ctrl+Enter</kbd></button>- <div class="dropdown" id="note-type">+ <div class="dropdown" id="note-type" data-bind="visible: type() != 'search'"><button data-bind="disable: isDisabled()" id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="btn btn-sm">Type: <span data-bind="text: typeString()"></span><span class="caret"></span>@@ -106,8 +106,6 @@<ul id="note-type-dropdown" class="dropdown-menu dropdown-menu-right" aria-labelledby="dLabel"><li data-bind="click: selectText, css: { selected: type() == 'text' }"><span class="check">✓</span> <strong>Text</strong></li><li role="separator" class="divider"></li>- <li data-bind="click: selectSavedSearch, css: { selected: type() == 'search' }"><span class="check">✓</span> <strong>Saved search</strong></li>- <li role="separator" class="divider"></li><li data-bind="click: selectRender, css: { selected: type() == 'render' && mime() == '' }"><span class="check">✓</span> <strong>Render HTML note</strong></li><li role="separator" class="divider"></li><li data-bind="click: selectCode, css: { selected: type() == 'code' && mime() == '' }"><span class="check">✓</span> <strong>Code</strong></li>