diff --git a/addon/chrome/content/bubbleMap.html b/addon/chrome/content/bubbleMap.html
index ac80ce5..359773e 100644
--- a/addon/chrome/content/bubbleMap.html
+++ b/addon/chrome/content/bubbleMap.html
@@ -72,7 +72,7 @@
// For details, see https://gojs.net/latest/intro/buildingObjects.html
const $ = go.GraphObject.make; // for conciseness in defining templates
- myDiagram = $(
+ const Diagram = $(
go.Diagram,
"myDiagramDiv", // must name or refer to the DIV HTML element
{
@@ -88,7 +88,7 @@
);
// dragging a node invalidates the Diagram.layout, causing a layout during the drag
- myDiagram.toolManager.draggingTool.doMouseMove = function () {
+ Diagram.toolManager.draggingTool.doMouseMove = function () {
go.DraggingTool.prototype.doMouseMove.call(this);
if (this.isActive) {
this.diagram.layout.invalidateLayout();
@@ -96,7 +96,7 @@
};
// define each Node's appearance
- myDiagram.nodeTemplate = $(
+ Diagram.nodeTemplate = $(
go.Node,
"Vertical", // the whole node panel
// define the node's outer shape, which will surround the TextBlock
@@ -126,7 +126,7 @@
// the rest of this app is the same as samples/conceptMap.html
// selected nodes show a button for adding children
- myDiagram.nodeTemplate.selectionAdornmentTemplate = $(
+ Diagram.nodeTemplate.selectionAdornmentTemplate = $(
go.Adornment,
"Spot",
$(
@@ -153,7 +153,7 @@
);
// replace the default Link template in the linkTemplateMap
- myDiagram.linkTemplate = $(
+ Diagram.linkTemplate = $(
go.Link, // the whole link panel
$(
go.Shape, // the link shape
diff --git a/addon/chrome/content/mindMap.html b/addon/chrome/content/mindMap.html
index 5769f4c..ce0c834 100644
--- a/addon/chrome/content/mindMap.html
+++ b/addon/chrome/content/mindMap.html
@@ -26,7 +26,7 @@
// For details, see https://gojs.net/latest/intro/buildingObjects.html
const $ = go.GraphObject.make;
- myDiagram = $(go.Diagram, "myDiagramDiv", {
+ const Diagram = $(go.Diagram, "myDiagramDiv", {
"commandHandler.copiesTree": true,
"commandHandler.copiesParentKey": true,
"commandHandler.deletesTree": true,
@@ -39,7 +39,7 @@
});
// a node consists of some text with a line shape underneath
- myDiagram.nodeTemplate = $(
+ Diagram.nodeTemplate = $(
go.Node,
"Vertical",
{ selectionObjectName: "TEXT" },
@@ -86,7 +86,7 @@
);
// selected nodes show a button for adding children
- myDiagram.nodeTemplate.selectionAdornmentTemplate = $(
+ Diagram.nodeTemplate.selectionAdornmentTemplate = $(
go.Adornment,
"Spot",
$(
@@ -113,7 +113,7 @@
);
// a link is just a Bezier-curved line of the same color as the node to which it is connected
- myDiagram.linkTemplate = $(
+ Diagram.linkTemplate = $(
go.Link,
{
curve: go.Link.Bezier,
@@ -131,9 +131,9 @@
)
);
- myDiagram.addDiagramListener("SelectionMoved", (e) => {
- var rootX = myDiagram.findNodeForKey(0).location.x;
- myDiagram.selection.each((node) => {
+ Diagram.addDiagramListener("SelectionMoved", (e) => {
+ var rootX = Diagram.findNodeForKey(0).location.x;
+ Diagram.selection.each((node) => {
if (node.data.parent !== 0) return; // Only consider nodes connected to the root
var nodeX = node.location.x;
if (rootX < nodeX && node.data.dir !== "right") {
diff --git a/src/note/noteUtils.ts b/src/note/noteUtils.ts
index dec9c4f..613f934 100644
--- a/src/note/noteUtils.ts
+++ b/src/note/noteUtils.ts
@@ -363,14 +363,14 @@ class NoteUtils extends AddonBase {
);
}
- moveHeaderLineInNote(
+ async moveHeaderLineInNote(
note: Zotero.Item,
currentNode: TreeModel.Node