kamrify commited on
Commit
fe79342
·
1 Parent(s): 3dfa288

Allow highlight without animation

Browse files
Files changed (1) hide show
  1. assets/scripts/src/overlay.js +8 -1
assets/scripts/src/overlay.js CHANGED
@@ -38,7 +38,7 @@ export default class Overlay {
38
  }
39
 
40
  // Highlights the dom element on the screen
41
- highlight(element) {
42
  if (!element) {
43
  return;
44
  }
@@ -51,6 +51,13 @@ export default class Overlay {
51
 
52
  this.highlightedElement = element;
53
  this.positionToHighlight = position;
 
 
 
 
 
 
 
54
  this.draw();
55
  }
56
 
 
38
  }
39
 
40
  // Highlights the dom element on the screen
41
+ highlight(element, animate = true) {
42
  if (!element) {
43
  return;
44
  }
 
51
 
52
  this.highlightedElement = element;
53
  this.positionToHighlight = position;
54
+
55
+ // If animation is not required then set the last path to be same
56
+ // as the current path so that there is no easing towards it
57
+ if (!animate) {
58
+ this.highlightedPosition = this.positionToHighlight;
59
+ }
60
+
61
  this.draw();
62
  }
63