Browse Source

Fix cursor path

Joeri Exelmans 4 years ago
parent
commit
e3e060a88f

+ 3 - 2
lib/versioning/GhostOverlays.js

@@ -1,11 +1,12 @@
 const { UserColors } = require("./UserColors.js");
 
 class GhostOverlays {
-  constructor(graph, userColors) {
+  constructor(graph, userColors, cursorHref) {
     // this.userNames = userNames;
     this.userColors = userColors;
     this.canvas = graph.view.canvas;
     this.svg = this.canvas.parentElement;
+    this.cursorHref = cursorHref;
 
     this.map = new Map();
   }
@@ -22,7 +23,7 @@ class GhostOverlays {
       text.setAttribute('y', 30);
       const textNode = document.createTextNode("");
       text.appendChild(textNode);
-      image.setAttribute('href', "/lib/versioning/resources/cursor.svg");
+      image.setAttribute('href', this.cursorHref);
       image.setAttribute('width', 11.6);
       image.setAttribute('height', 18.2);
       g.appendChild(image);

+ 4 - 3
src/main/webapp/plugins/cdf/versioning.browser.js

@@ -955,11 +955,12 @@ module.exports = { DragHandler };
 const { UserColors } = require("./UserColors.js");
 
 class GhostOverlays {
-  constructor(graph, userColors) {
+  constructor(graph, userColors, cursorHref) {
     // this.userNames = userNames;
     this.userColors = userColors;
     this.canvas = graph.view.canvas;
     this.svg = this.canvas.parentElement;
+    this.cursorHref = cursorHref;
 
     this.map = new Map();
   }
@@ -976,7 +977,7 @@ class GhostOverlays {
       text.setAttribute('y', 30);
       const textNode = document.createTextNode("");
       text.appendChild(textNode);
-      image.setAttribute('href', "/lib/versioning/resources/cursor.svg");
+      image.setAttribute('href', this.cursorHref);
       image.setAttribute('width', 11.6);
       image.setAttribute('height', 18.2);
       g.appendChild(image);
@@ -1671,7 +1672,7 @@ Draw.loadPlugin(async function(ui) {
   const dragHandler = new DragHandler(controller);
   dragHandler.install(graph);
 
-  const ghostOverlays = new GhostOverlays(graph, userColors);
+  const ghostOverlays = new GhostOverlays(graph, userColors, "../../../lib/versioning/resources/cursor.svg");
 
   graph.addMouseListener({
     mouseDown(graph, event) {

+ 1 - 1
src/main/webapp/plugins/cdf/versioning.js

@@ -396,7 +396,7 @@ Draw.loadPlugin(async function(ui) {
   const dragHandler = new DragHandler(controller);
   dragHandler.install(graph);
 
-  const ghostOverlays = new GhostOverlays(graph, userColors);
+  const ghostOverlays = new GhostOverlays(graph, userColors, "../../../lib/versioning/resources/cursor.svg");
 
   graph.addMouseListener({
     mouseDown(graph, event) {