Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var deltaTime = timeNow - this.lastMotionUpdateTime;
deltaTime = Math.max(10, deltaTime); // low-timer granularity compensation
this.lastMotionUpdateTime = 0;
if (this.scrollX)
{
// 100msec is a full hold gesture that complete zeroes out the velocity to be used as inertia
this.currentVelocityX *= 1 - Math.min(1, Math.max(0, deltaTime / 100));
}
if (this.scrollY)
this.currentVelocityY *= 1 - Math.min(1, Math.max(0, deltaTime / 100));
Event.removeGlobalHandler('mousemove', this.onMouseMove, this);
Event.removeGlobalHandler('touchmove', this.onMouseMove, this);
Event.removeGlobalHandler('mouseup', this.onMouseUp, this);
Event.removeGlobalHandler('touchend', this.onMouseUp, this);
if (this.minScrollDeltaXReached || this.minScrollDeltaYReached)
Event.captureEvent('click', basis.fn.$true);
this.emit_startInertia();
},
function stopInspect() {
if (inspectMode.value) {
domEventUtils.removeGlobalHandler('mousemove', mousemoveHandler);
domEventUtils.removeGlobalHandler('mousewheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('wheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('DOMMouseScroll', mouseWheelHandler);
domEventUtils.removeGlobalHandler('mousedown', domEventUtils.kill);
domEventUtils.removeGlobalHandler('mouseup', domEventUtils.kill);
domEventUtils.removeGlobalHandler('contextmenu', contextmenuHandler);
domEventUtils.removeGlobalHandler('click', pickHandler);
inspectMode.set(false);
pickupTarget.set();
}
}
function stopInspect() {
if (inspectMode.value) {
domEventUtils.removeGlobalHandler('mousemove', mousemoveHandler);
domEventUtils.removeGlobalHandler('mousewheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('wheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('DOMMouseScroll', mouseWheelHandler);
domEventUtils.removeGlobalHandler('mousedown', domEventUtils.kill);
domEventUtils.removeGlobalHandler('mouseup', domEventUtils.kill);
domEventUtils.removeGlobalHandler('contextmenu', contextmenuHandler);
domEventUtils.removeGlobalHandler('click', pickHandler);
inspectMode.set(false);
pickupTargetNode.set();
}
}
function stopInspect() {
if (inspectMode.value) {
domEventUtils.removeGlobalHandler('mousemove', mousemoveHandler);
domEventUtils.removeGlobalHandler('mousewheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('wheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('DOMMouseScroll', mouseWheelHandler);
domEventUtils.removeGlobalHandler('mousedown', domEventUtils.kill);
domEventUtils.removeGlobalHandler('mouseup', domEventUtils.kill);
domEventUtils.removeGlobalHandler('contextmenu', contextmenuHandler);
domEventUtils.removeGlobalHandler('click', pickHandler);
inspectMode.set(false);
pickupTarget.set();
}
}
function stopInspect(){
if (inspectMode.value)
{
domEventUtils.removeGlobalHandler('mousemove', mousemoveHandler);
domEventUtils.removeGlobalHandler('mousewheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('wheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('DOMMouseScroll', mouseWheelHandler);
domEventUtils.removeGlobalHandler('mousedown');
domEventUtils.removeGlobalHandler('mouseup');
domEventUtils.removeGlobalHandler('contextmenu');
domEventUtils.removeGlobalHandler('click', pickHandler);
inspectMode.set(false);
pickupTarget.set();
}
}
function stopInspect(){
if (inspecting)
{
domEventUtils.removeGlobalHandler('mousemove', mousemoveHandler);
domEventUtils.removeGlobalHandler('mousewheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('wheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('DOMMouseScroll', mouseWheelHandler);
inspectBasisEvent.releaseEvent('mousedown');
inspectBasisEvent.releaseEvent('mouseup');
inspectBasisEvent.releaseEvent('contextmenu');
inspectBasisEvent.releaseEvent('click');
inspecting = false;
pickupTarget.set();
}
}
function stopInspect() {
if (inspectMode.value) {
domEventUtils.removeGlobalHandler('mousemove', mousemoveHandler);
domEventUtils.removeGlobalHandler('mousewheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('wheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('DOMMouseScroll', mouseWheelHandler);
domEventUtils.removeGlobalHandler('mousedown', domEventUtils.kill);
domEventUtils.removeGlobalHandler('mouseup', domEventUtils.kill);
domEventUtils.removeGlobalHandler('contextmenu', contextmenuHandler);
domEventUtils.removeGlobalHandler('click', pickHandler);
inspectMode.set(false);
pickupTargetNode.set();
}
}
function stopInspect(){
if (inspectMode.value)
{
domEventUtils.removeGlobalHandler('mousemove', mousemoveHandler);
domEventUtils.removeGlobalHandler('mousewheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('wheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('DOMMouseScroll', mouseWheelHandler);
domEventUtils.removeGlobalHandler('mousedown');
domEventUtils.removeGlobalHandler('mouseup');
domEventUtils.removeGlobalHandler('contextmenu');
domEventUtils.removeGlobalHandler('click', pickHandler);
inspectMode.set(false);
pickupTarget.set();
}
}
function stopWatch(){
if (observer)
observer.disconnect();
eventUtils.removeGlobalHandler('scroll', updateOnScroll);
eventUtils.removeGlobalHandler('mousemove', update);
eventUtils.removeGlobalHandler('pointermove', update);
eventUtils.removeGlobalHandler('focus', update);
eventUtils.removeGlobalHandler('focusIn', update);
eventUtils.removeGlobalHandler('focusOut', update);
eventUtils.removeGlobalHandler('blur', update);
eventUtils.removeHandler(global, 'resize', updateOnResize);
inspectBasisEvent.releaseEvent('contextmenu');
}
function stopInspect(){
if (inspectMode.value)
{
domEventUtils.removeGlobalHandler('mousemove', mousemoveHandler);
domEventUtils.removeGlobalHandler('mousewheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('wheel', mouseWheelHandler);
domEventUtils.removeGlobalHandler('DOMMouseScroll', mouseWheelHandler);
domEventUtils.removeGlobalHandler('mousedown');
domEventUtils.removeGlobalHandler('mouseup');
domEventUtils.removeGlobalHandler('contextmenu');
domEventUtils.removeGlobalHandler('click', pickHandler);
inspectMode.set(false);
pickupTarget.set();
}
}