mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 04:45:47 +01:00
closing of attr detail
This commit is contained in:
@@ -37,9 +37,18 @@ const TPL = `
|
||||
.attr-edit td input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.close-attr-detail-button {
|
||||
font-size: x-large;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h5>Label detail</h5>
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<h5>Label detail</h5>
|
||||
|
||||
<span class="bx bx-x close-attr-detail-button"></span>
|
||||
</div>
|
||||
|
||||
<table class="attr-edit">
|
||||
<tr>
|
||||
@@ -91,8 +100,17 @@ export default class AttributeDetailWidget extends BasicWidget {
|
||||
this.$attrEditName = this.$widget.find('.attr-edit-name');
|
||||
this.$attrEditValue = this.$widget.find('.attr-edit-value');
|
||||
this.$attrEditInheritable = this.$widget.find('.attr-edit-inheritable');
|
||||
this.$closeAttrDetailButton = this.$widget.find('.close-attr-detail-button');
|
||||
|
||||
return this.$widget;
|
||||
this.$closeAttrDetailButton.on('click', () => this.hide());
|
||||
|
||||
$(window).on('mouseup', e => {
|
||||
console.log("click", e.target);
|
||||
|
||||
if (!$(e.target).closest(this.$widget[0]).length) {
|
||||
this.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async showAttributeDetail(attr, x, y) {
|
||||
@@ -140,7 +158,7 @@ export default class AttributeDetailWidget extends BasicWidget {
|
||||
this.$relatedNotesMoreNotes.hide();
|
||||
}
|
||||
|
||||
this.$attrEditName.val(attr.name);
|
||||
this.$attrEditName.val(attr.name).focus();
|
||||
this.$attrEditValue.val(attr.value);
|
||||
|
||||
this.$widget.css("left", x - this.$widget.width() / 2);
|
||||
|
||||
@@ -70,8 +70,6 @@ export default class CollapsibleWidget extends TabAwareWidget {
|
||||
this.initialized = this.doRenderBody();
|
||||
|
||||
this.decorateWidget();
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
saveCollapsed(collapse) {
|
||||
@@ -99,4 +97,4 @@ export default class CollapsibleWidget extends TabAwareWidget {
|
||||
isExpanded() {
|
||||
return this.$bodyWrapper.hasClass("show");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,5 @@ export default class FlexContainer extends BasicWidget {
|
||||
for (const widget of this.children) {
|
||||
this.$widget.append(widget.render());
|
||||
}
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,5 @@ export default class GlobalMenuWidget extends BasicWidget {
|
||||
this.$widget.find(".logout-button").toggle(!utils.isElectron());
|
||||
|
||||
this.$widget.find(".open-dev-tools-button").toggle(utils.isElectron());
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,8 +51,6 @@ export default class HistoryNavigationWidget extends BasicWidget {
|
||||
else {
|
||||
this.$widget = $("<div>");
|
||||
}
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async showContextMenu(e) {
|
||||
@@ -101,4 +99,4 @@ export default class HistoryNavigationWidget extends BasicWidget {
|
||||
activeNoteChangedEvent() {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,7 @@ class CloseDetailButtonWidget extends BasicWidget {
|
||||
this.$widget = $(TPL);
|
||||
|
||||
this.$widget.on('click', () => this.triggerCommand('setActiveScreen', {screen:'tree'}));
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
}
|
||||
|
||||
export default CloseDetailButtonWidget;
|
||||
export default CloseDetailButtonWidget;
|
||||
|
||||
@@ -38,9 +38,7 @@ class MobileDetailMenuWidget extends BasicWidget {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
}
|
||||
|
||||
export default MobileDetailMenuWidget;
|
||||
export default MobileDetailMenuWidget;
|
||||
|
||||
@@ -113,8 +113,6 @@ export default class NoteActionsWidget extends TabAwareWidget {
|
||||
|
||||
this.$unprotectButton = this.$widget.find(".unprotect-button");
|
||||
this.$unprotectButton.on('click', () => protectedSessionService.protectNote(this.noteId, false, false));
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
refreshWithNote(note) {
|
||||
@@ -140,4 +138,4 @@ export default class NoteActionsWidget extends TabAwareWidget {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,12 +234,6 @@ export default class NoteAttributesWidget extends TabAwareWidget {
|
||||
this.attributeDetailWidget.hide();
|
||||
});
|
||||
|
||||
this.$editor.on('blur', () => {
|
||||
this.save();
|
||||
|
||||
this.attributeDetailWidget.hide();
|
||||
});
|
||||
|
||||
this.$widget.append(this.attributeDetailWidget.render());
|
||||
}
|
||||
|
||||
|
||||
@@ -100,8 +100,6 @@ export default class NoteDetailWidget extends TabAwareWidget {
|
||||
replaceUnderscoresWithSpaces: true
|
||||
});
|
||||
});
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async refresh() {
|
||||
|
||||
@@ -57,8 +57,6 @@ export default class NotePathsWidget extends TabAwareWidget {
|
||||
this.$notePathList = this.$dropdown.find(".note-path-list");
|
||||
|
||||
this.$dropdown.on('show.bs.dropdown', () => this.renderDropdown());
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async refreshWithNote(note, notePath) {
|
||||
|
||||
@@ -48,8 +48,6 @@ export default class NoteTitleWidget extends TabAwareWidget {
|
||||
utils.bindElShortcut(this.$noteTitle, 'return', () => {
|
||||
this.triggerCommand('focusOnAttributes', {tabId: this.tabContext.tabId});
|
||||
});
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async refreshWithNote(note) {
|
||||
|
||||
@@ -250,8 +250,6 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
this.initialized = this.initFancyTree();
|
||||
|
||||
this.setupNoteTitleTooltip();
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
setupNoteTitleTooltip() {
|
||||
|
||||
@@ -40,8 +40,6 @@ export default class NoteTypeWidget extends TabAwareWidget {
|
||||
this.$noteTypeDropdown = this.$widget.find(".note-type-dropdown");
|
||||
this.$noteTypeButton = this.$widget.find(".note-type-button");
|
||||
this.$noteTypeDesc = this.$widget.find(".note-type-desc");
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async refreshWithNote(note) {
|
||||
@@ -147,4 +145,4 @@ export default class NoteTypeWidget extends TabAwareWidget {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,6 @@ export default class PromotedAttributesWidget extends TabAwareWidget {
|
||||
this.$widget = $(TPL);
|
||||
|
||||
this.$container = this.$widget.find(".promoted-attributes");
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async refreshWithNote(note) {
|
||||
|
||||
@@ -17,8 +17,6 @@ export default class RunScriptButtonsWidget extends TabAwareWidget {
|
||||
|
||||
this.$renderButton = this.$widget.find('.render-button');
|
||||
this.$executeScriptButton = this.$widget.find('.execute-script-button');
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
refreshWithNote(note) {
|
||||
@@ -31,4 +29,4 @@ export default class RunScriptButtonsWidget extends TabAwareWidget {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,8 +71,6 @@ export default class SearchBoxWidget extends BasicWidget {
|
||||
this.$saveSearchButton.on('click', () => this.saveSearch());
|
||||
|
||||
this.$closeSearchButton.on('click', () => this.hideSearch());
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
doSearch(searchText) {
|
||||
@@ -174,4 +172,4 @@ export default class SearchBoxWidget extends BasicWidget {
|
||||
|
||||
this.$searchInput.val(`@in=${noteId} @text*=*`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,6 @@ export default class SearchResultsWidget extends BasicWidget {
|
||||
this.$searchResultsInner = this.$widget.find(".search-results-list");
|
||||
|
||||
this.toggleInt(false);
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
searchResultsEvent({results}) {
|
||||
|
||||
@@ -43,8 +43,6 @@ export default class SidePaneToggles extends BasicWidget {
|
||||
|
||||
this.$widget.find(".show-left-pane-button").on('click', () => this.toggleAndSave('left', true));
|
||||
this.$widget.find(".hide-left-pane-button").on('click', () => this.toggleAndSave('left', false));
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
toggleSidebar(side, show) {
|
||||
|
||||
@@ -267,8 +267,6 @@ export default class TabRowWidget extends BasicWidget {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
setupStyle() {
|
||||
|
||||
@@ -63,7 +63,5 @@ export default class TitleBarButtonsWidget extends BasicWidget {
|
||||
const {remote} = utils.dynamicRequire('electron');
|
||||
remote.BrowserWindow.getFocusedWindow().close();
|
||||
});
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,8 +170,6 @@ export default class BookTypeWidget extends TypeWidget {
|
||||
|
||||
$card.find('.note-book-children-content').empty();
|
||||
});
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async expandCard($card) {
|
||||
|
||||
@@ -14,7 +14,5 @@ export default class DeletedTypeWidget extends TypeWidget {
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,8 +82,6 @@ export default class EditableCodeTypeWidget extends TypeWidget {
|
||||
this.$sqlConsoleExecuteButton.on('click', () => this.execute());
|
||||
|
||||
this.initialized = this.initEditor();
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async initEditor() {
|
||||
|
||||
@@ -88,8 +88,6 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
||||
keyboardActionService.setupActionsForElement('text-detail', this.$widget, this);
|
||||
|
||||
super.doRender();
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async initEditor() {
|
||||
|
||||
@@ -31,11 +31,9 @@ export default class EmptyTypeWidget extends TypeWidget {
|
||||
});
|
||||
|
||||
noteAutocompleteService.showRecentNotes(this.$autoComplete);
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
doRefresh(note) {
|
||||
this.$autoComplete.trigger('focus');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,8 +116,6 @@ export default class FileTypeWidget extends TypeWidget {
|
||||
toastService.showError("Upload of a new file revision failed.");
|
||||
}
|
||||
});
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async doRefresh(note) {
|
||||
|
||||
@@ -119,8 +119,6 @@ class ImageTypeWidget extends TypeWidget {
|
||||
toastService.showError("Upload of a new image revision failed: " + result.message);
|
||||
}
|
||||
});
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async doRefresh(note) {
|
||||
|
||||
@@ -36,7 +36,5 @@ export default class ProtectedSessionTypeWidget extends TypeWidget {
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,6 @@ export default class ReadOnlyCodeTypeWidget extends TypeWidget {
|
||||
|
||||
this.triggerEvent('codePreviewDisabled', {tabContext: this.tabContext});
|
||||
});
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async doRefresh(note) {
|
||||
|
||||
@@ -52,8 +52,6 @@ export default class ReadOnlyTextTypeWidget extends AbstractTextTypeWidget {
|
||||
});
|
||||
|
||||
super.doRender();
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
|
||||
@@ -182,8 +182,6 @@ export default class RelationMapTypeWidget extends TypeWidget {
|
||||
|
||||
jsPlumb.ready(res);
|
||||
});
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async contextMenuHandler(command, originalTarget) {
|
||||
@@ -632,4 +630,4 @@ export default class RelationMapTypeWidget extends TypeWidget {
|
||||
getContent() {
|
||||
return JSON.stringify(this.mapData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@ export default class RenderTypeWidget extends TypeWidget {
|
||||
this.$widget = $(TPL);
|
||||
this.$noteDetailRenderHelp = this.$widget.find('.note-detail-render-help');
|
||||
this.$noteDetailRenderContent = this.$widget.find('.note-detail-render-content');
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async doRefresh(note) {
|
||||
@@ -49,4 +47,4 @@ export default class RenderTypeWidget extends TypeWidget {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,8 +20,6 @@ export default class SearchTypeWidget extends TypeWidget {
|
||||
this.$searchString = this.$widget.find(".search-string");
|
||||
this.$component = this.$widget.find('.note-detail-search');
|
||||
this.$help = this.$widget.find(".note-detail-search-help");
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async doRefresh(note) {
|
||||
@@ -48,4 +46,4 @@ export default class SearchTypeWidget extends TypeWidget {
|
||||
searchString: this.$searchString.val()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user