|
1 | | -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ |
| 1 | +(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){ |
2 | 2 | 'use strict'; |
3 | 3 |
|
4 | 4 | /* global AFRAME */ |
@@ -186,9 +186,9 @@ AFRAME.registerComponent('super-hands', { |
186 | 186 | }, |
187 | 187 | onStretchEndButton: function (evt) { |
188 | 188 | const stretched = this.state.get(this.STRETCH_EVENT); |
189 | | - const endEvt = { hand: this.el, buttonEvent: evt }; |
190 | | - // check if end event accepted |
191 | | - if (stretched && !this.emitCancelable(stretched, this.UNSTRETCH_EVENT, endEvt)) { |
| 189 | + const endEvt = { hand: this.el, buttonEvent: evt |
| 190 | + // check if end event accepted |
| 191 | + };if (stretched && !this.emitCancelable(stretched, this.UNSTRETCH_EVENT, endEvt)) { |
192 | 192 | this.promoteHoveredEl(stretched); |
193 | 193 | this.state.delete(this.STRETCH_EVENT); |
194 | 194 | this.hover(); |
@@ -402,24 +402,26 @@ AFRAME.registerComponent('super-hands', { |
402 | 402 | this.el.addEventListener(this.data.colliderEndEvent, this.unWatch); |
403 | 403 | this.el.addEventListener(this.data.colliderEndEvent, this.unHover); |
404 | 404 |
|
| 405 | + // binding order to keep grabEnd from triggering dragover |
| 406 | + // again before dragDropEnd can delete its carried state |
405 | 407 | this.data.grabStartButtons.forEach(b => { |
406 | 408 | this.el.addEventListener(b, this.onGrabStartButton); |
407 | 409 | }); |
408 | | - this.data.grabEndButtons.forEach(b => { |
409 | | - this.el.addEventListener(b, this.onGrabEndButton); |
410 | | - }); |
411 | 410 | this.data.stretchStartButtons.forEach(b => { |
412 | 411 | this.el.addEventListener(b, this.onStretchStartButton); |
413 | 412 | }); |
414 | | - this.data.stretchEndButtons.forEach(b => { |
415 | | - this.el.addEventListener(b, this.onStretchEndButton); |
416 | | - }); |
417 | 413 | this.data.dragDropStartButtons.forEach(b => { |
418 | 414 | this.el.addEventListener(b, this.onDragDropStartButton); |
419 | 415 | }); |
420 | 416 | this.data.dragDropEndButtons.forEach(b => { |
421 | 417 | this.el.addEventListener(b, this.onDragDropEndButton); |
422 | 418 | }); |
| 419 | + this.data.stretchEndButtons.forEach(b => { |
| 420 | + this.el.addEventListener(b, this.onStretchEndButton); |
| 421 | + }); |
| 422 | + this.data.grabEndButtons.forEach(b => { |
| 423 | + this.el.addEventListener(b, this.onGrabEndButton); |
| 424 | + }); |
423 | 425 | }, |
424 | 426 | unRegisterListeners: function (data) { |
425 | 427 | data = data || this.data; |
@@ -1119,9 +1121,9 @@ AFRAME.registerComponent('grabbable', inherit(base, { |
1119 | 1121 | this.deltaPositionIsValid = false; |
1120 | 1122 | this.grabDistance = undefined; |
1121 | 1123 | this.grabDirection = { x: 0, y: 0, z: -1 }; |
1122 | | - this.grabOffset = { x: 0, y: 0, z: 0 }; |
1123 | | - // persistent object speeds up repeat setAttribute calls |
1124 | | - this.destPosition = { x: 0, y: 0, z: 0 }; |
| 1124 | + this.grabOffset = { x: 0, y: 0, z: 0 |
| 1125 | + // persistent object speeds up repeat setAttribute calls |
| 1126 | + };this.destPosition = { x: 0, y: 0, z: 0 }; |
1125 | 1127 | this.deltaPosition = new THREE.Vector3(); |
1126 | 1128 | this.targetPosition = new THREE.Vector3(); |
1127 | 1129 | this.physicsInit(); |
|
0 commit comments