documentatie
This commit is contained in:
@@ -48,6 +48,12 @@ export class CmapConceptController {
|
||||
this.getDialog()?.openNew(context, this.dialogResources());
|
||||
}
|
||||
|
||||
/**
|
||||
* goal : Apply one validated concept-dialog submission as one editor history step.
|
||||
* pre : record identifies an existing placement, or createContext describes a new placement.
|
||||
* post : Shared concept content and placement presentation are updated and autosave is scheduled.
|
||||
* result : False when the editor or required create context is unavailable.
|
||||
*/
|
||||
async saveConcept(record, createContext, values) {
|
||||
const editor = this.getEditor();
|
||||
if ((!record && !createContext) || !editor) return false;
|
||||
@@ -101,6 +107,7 @@ export class CmapConceptController {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Update selection-dependent layout and concept action availability in the toolbar. */
|
||||
updateSelectionToolbar(editor, selectedRecords = [], connector = null) {
|
||||
const toolbar = document.getElementById("cmap-selection-toolbar");
|
||||
const selected = Array.isArray(selectedRecords) ? selectedRecords : [];
|
||||
@@ -127,6 +134,12 @@ export class CmapConceptController {
|
||||
parts.slug.toLocaleLowerCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* goal : Move selected concept description pages into the active CMap namespace.
|
||||
* pre : An active CMap namespace exists and selected records may have description references.
|
||||
* post : Existing pages are renamed, editor references are changed and the map is autosaved.
|
||||
* result : False when no applicable selection exists or a target-page conflict is found.
|
||||
*/
|
||||
async moveSelectedDescriptionsToNamespace() {
|
||||
const editor = this.getEditor();
|
||||
const namespace = this.getNamespace();
|
||||
@@ -187,6 +200,7 @@ export class CmapConceptController {
|
||||
return options;
|
||||
}
|
||||
|
||||
/** Open inline phrase editing or the concept dialog for the selected editor record. */
|
||||
editSelected(record = null) {
|
||||
const editor = this.getEditor();
|
||||
const selectedRecord = record || editor?.selected();
|
||||
@@ -201,6 +215,7 @@ export class CmapConceptController {
|
||||
this.openDialog(selectedRecord);
|
||||
}
|
||||
|
||||
/** Group the current editor selection into a named inline submap. */
|
||||
groupSelection() {
|
||||
const editor = this.getEditor();
|
||||
if (!editor || !editor.canGroupSelection()) return false;
|
||||
@@ -216,6 +231,7 @@ export class CmapConceptController {
|
||||
});
|
||||
}
|
||||
|
||||
/** Populate a newly opened sample submap with its initial child records. */
|
||||
populateSubmap(record, editor) {
|
||||
const baseX = Number(record.node.attr("x"));
|
||||
const baseY = Number(record.node.attr("y"));
|
||||
|
||||
Reference in New Issue
Block a user