From c2a6cad9044162e43a251516e721f3ec4decd93f Mon Sep 17 00:00:00 2001
From: Kevin Lee <kevin@infinite-lee.com>
Date: Wed, 22 Aug 2018 17:55:35 -0700
Subject: [PATCH] rename sticky class to toggle so it doesn't get confused with
 sticky-object and sticky-zones

---
 src/hub.html                      | 4 ++--
 src/utils/action-event-handler.js | 6 +++---
 src/utils/mouse-events-handler.js | 8 ++++----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/hub.html b/src/hub.html
index 78b711a7d..bed2602ea 100644
--- a/src/hub.html
+++ b/src/hub.html
@@ -188,7 +188,7 @@
 
             <template id="pen-interactable">
                 <a-entity
-                    class="interactable sticky"
+                    class="interactable toggle"
                     super-networked-interactable="counter: #pen-counter; mass: 1;"
                     body="type: dynamic; shape: none; mass: 1;"
                     sticky-object="autoLockOnRelease: true; autoLockOnLoad: true;"
@@ -456,7 +456,7 @@
 
         <a-entity 
             gltf-model-plus="src: https://asset-bundles-prod.reticulum.io/interactables/DrawingPen/DrawingPen-484ae5682f.gltf"
-            class="interactable sticky" 
+            class="interactable toggle" 
             super-spawner="template: #pen-interactable; src: https://asset-bundles-prod.reticulum.io/interactables/DrawingPen/DrawingPen-484ae5682f.gltf;" 
             position="-1 1.2 -5.5"
             scale="0.5 0.5 0.5" 
diff --git a/src/utils/action-event-handler.js b/src/utils/action-event-handler.js
index c67734026..80c8d6fb9 100644
--- a/src/utils/action-event-handler.js
+++ b/src/utils/action-event-handler.js
@@ -100,8 +100,8 @@ export default class ActionEventHandler {
     this.handThatAlsoDrivesCursor = handThatAlsoDrivesCursor;
   }
 
-  isSticky(el) {
-    return el && el.matches(".sticky, .sticky *");
+  isToggle(el) {
+    return el && el.matches(".toggle, .toggle *");
   }
 
   isHandThatAlsoDrivesCursor(el) {
@@ -130,7 +130,7 @@ export default class ActionEventHandler {
     const isCursorHand = this.isHandThatAlsoDrivesCursor(e.target);
     if (this.isCursorInteracting && isCursorHand) {
       //need to check both grab-start and hover-start in the case that the spawner is being grabbed this frame
-      if (this.isSticky(this.cursorHand.state.get("grab-start") || this.cursorHand.state.get("hover-start"))) {
+      if (this.isToggle(this.cursorHand.state.get("grab-start") || this.cursorHand.state.get("hover-start"))) {
         this.cursorHand.el.emit(event);
         this.isCursorInteracting = !!this.cursorHand.state.get("grab-start");
       } else {
diff --git a/src/utils/mouse-events-handler.js b/src/utils/mouse-events-handler.js
index 505ddb96f..1fde2e203 100644
--- a/src/utils/mouse-events-handler.js
+++ b/src/utils/mouse-events-handler.js
@@ -65,7 +65,7 @@ export default class MouseEventsHandler {
 
   onLeftButtonDown() {
     this.isLeftButtonDown = true;
-    if (this.isSticky(this.superHand.state.get("grab-start"))) {
+    if (this.isToggle(this.superHand.state.get("grab-start"))) {
       this.superHand.el.emit("secondary-cursor-grab");
     }
     this.isLeftButtonHandledByCursor = this.cursor.startInteraction();
@@ -132,7 +132,7 @@ export default class MouseEventsHandler {
   onMouseUp(e) {
     switch (e.button) {
       case 0: //left button
-        if (this.isSticky(this.superHand.state.get("grab-start"))) {
+        if (this.isToggle(this.superHand.state.get("grab-start"))) {
           this.superHand.el.emit("secondary-cursor-release");
         } else {
           this.endInteraction();
@@ -152,8 +152,8 @@ export default class MouseEventsHandler {
     this.isLeftButtonHandledByCursor = false;
   }
 
-  isSticky(el) {
-    return el && el.matches(".sticky, .sticky *");
+  isToggle(el) {
+    return el && el.matches(".toggle, .toggle *");
   }
 
   look(e) {
-- 
GitLab