cleaned up experimental attribute pane

This commit is contained in:
zadam 2019-12-23 21:13:56 +01:00
parent 0ebc947fbd
commit ea7257a5b2
3 changed files with 5 additions and 51 deletions

View File

@ -16,40 +16,6 @@ import noteAutocompleteService from "./note_autocomplete.js";
const $tabContentsContainer = $("#note-tab-container");
const mentionSetup = {
feeds: [
{
marker: '@',
feed: queryText => {
return new Promise((res, rej) => {
noteAutocompleteService.autocompleteSource(queryText, rows => {
if (rows.length === 1 && rows[0].title === 'No results') {
rows = [];
}
for (const row of rows) {
row.text = row.name = row.noteTitle;
row.id = '@' + row.text;
row.link = '#' + row.path;
}
res(rows);
});
});
},
itemRenderer: item => {
const itemElement = document.createElement('span');
itemElement.classList.add('mentions-item');
itemElement.innerHTML = `${item.highlightedTitle} `;
return itemElement;
},
minimumCharacters: 0
}
]
};
const componentClasses = {
'empty': "./note_detail_empty.js",
'text': "./note_detail_text.js",
@ -103,7 +69,6 @@ class TabContext {
this.$noteDetailComponents = this.$tabContent.find(".note-detail-component");
this.$scriptArea = this.$tabContent.find(".note-detail-script-area");
this.$savedIndicator = this.$tabContent.find(".saved-indicator");
this.$attributesEditor = this.$tabContent.find(".note-title-attributes");
this.noteChangeDisabled = false;
this.isNoteChanged = false;
this.attributes = new Attributes(this);
@ -150,16 +115,6 @@ class TabContext {
this.$unprotectButton.on('click', protectedSessionService.unprotectNoteAndSendToServer);
await this.initComponent();
await libraryLoader.requireLibrary(libraryLoader.CKEDITOR);
await BalloonEditor.create(this.$attributesEditor[0], {
placeholder: "type attributes here, e.g. @rock @year=2019",
mention: mentionSetup,
removePlugins: ['Autoformat'],
blockToolbar: [],
toolbar: []
});
}
async initComponent(disableAutoBook = false) {
@ -195,6 +150,10 @@ class TabContext {
this.setCurrentNotePathToHash();
if (this.sidebar) {
this.sidebar.noteLoaded(); // load async
}
this.noteChangeDisabled = true;
try {
@ -228,10 +187,6 @@ class TabContext {
this.noteType.update();
}
if (this.sidebar) {
this.sidebar.noteLoaded(); // load async
}
bundleService.executeRelationBundles(this.note, 'runOnNoteView', this);
}

View File

@ -410,6 +410,7 @@ body {
padding-top: 4px;
padding-left: 7px;
font-size: 90%;
height: 100%;
}
#right-pane .card {

View File

@ -68,6 +68,4 @@
</div>
</div>
</div>
<div class="note-title-attributes" tabindex="9999"></div>
</div>