mirror of
https://github.com/nasa/openmct.git
synced 2024-12-21 22:17:49 +00:00
fixes to entries (#6464)
* fixes to entries fix delete first notebook entry fix select unfocused on create * do not blur if nothing is focused
This commit is contained in:
parent
201c669328
commit
453b1f3009
@ -236,7 +236,7 @@ export default {
|
||||
sidebarCoversEntries: false,
|
||||
filteredAndSortedEntries: [],
|
||||
notebookAnnotations: {},
|
||||
selectedEntryId: '',
|
||||
selectedEntryId: undefined,
|
||||
activeTransaction: false,
|
||||
savingTransaction: false
|
||||
};
|
||||
@ -381,8 +381,10 @@ export default {
|
||||
});
|
||||
},
|
||||
updateSelection(selection) {
|
||||
if (selection?.[0]?.[0]?.context?.targetDetails?.entryId === undefined) {
|
||||
this.selectedEntryId = '';
|
||||
const keyString = this.openmct.objects.makeKeyString(this.domainObject.identifier);
|
||||
|
||||
if (selection?.[0]?.[0]?.context?.targetDetails?.[keyString]?.entryId === undefined) {
|
||||
this.selectedEntryId = undefined;
|
||||
}
|
||||
},
|
||||
async loadAnnotations() {
|
||||
@ -522,6 +524,8 @@ export default {
|
||||
this.openmct.notifications.alert('Warning: unable to delete entry');
|
||||
console.error(`unable to delete entry ${entryId} from section ${this.selectedSection}, page ${this.selectedPage}`);
|
||||
|
||||
this.cancelTransaction();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -534,10 +538,15 @@ export default {
|
||||
emphasis: true,
|
||||
callback: () => {
|
||||
const entries = getNotebookEntries(this.domainObject, this.selectedSection, this.selectedPage);
|
||||
if (entries) {
|
||||
entries.splice(entryPos, 1);
|
||||
this.updateEntries(entries);
|
||||
this.filterAndSortEntries();
|
||||
this.removeAnnotations(entryId);
|
||||
} else {
|
||||
this.cancelTransaction();
|
||||
}
|
||||
|
||||
dialog.dismiss();
|
||||
}
|
||||
},
|
||||
|
@ -54,7 +54,7 @@
|
||||
class="c-ne__remove c-icon-button c-icon-button--major icon-trash"
|
||||
title="Delete this entry"
|
||||
tabindex="-1"
|
||||
@click="deleteEntry"
|
||||
@click.stop.prevent="deleteEntry"
|
||||
>
|
||||
</button>
|
||||
</span>
|
||||
@ -466,8 +466,11 @@ export default {
|
||||
if (!this.isSelectedEntry) {
|
||||
$event.preventDefault();
|
||||
// blur the previous focused entry if clicking on non selected entry input
|
||||
const focusedElementId = document.activeElement?.id;
|
||||
if (focusedElementId !== this.entry.id) {
|
||||
document.activeElement.blur();
|
||||
}
|
||||
}
|
||||
},
|
||||
editingEntry() {
|
||||
this.editMode = true;
|
||||
|
Loading…
Reference in New Issue
Block a user