display note type only for non-search notes

This commit is contained in:
azivner 2018-03-13 19:47:34 -04:00
parent 9c32f66329
commit db514e8f41
2 changed files with 4 additions and 13 deletions

View File

@ -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('');

View File

@ -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">&check;</span> <strong>Text</strong></li>
<li role="separator" class="divider"></li>
<li data-bind="click: selectSavedSearch, css: { selected: type() == 'search' }"><span class="check">&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">&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">&check;</span> <strong>Code</strong></li>