From 09413f5fc794616ce61d357611141462d59ca04f Mon Sep 17 00:00:00 2001 From: shortcutme Date: Sat, 28 Oct 2017 02:40:35 +0200 Subject: [PATCH] Only zoom sidebar globe if mouse button is pressed down --- plugins/Sidebar/media-globe/all.js | 5 ++--- plugins/Sidebar/media-globe/globe.js | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Sidebar/media-globe/all.js b/plugins/Sidebar/media-globe/all.js index 6d41940f..5ddc0313 100644 --- a/plugins/Sidebar/media-globe/all.js +++ b/plugins/Sidebar/media-globe/all.js @@ -410,6 +410,7 @@ DAT.Globe = function(container, opts) { } function onMouseWheel(event) { + if (container.style.cursor != "move") return false; event.preventDefault(); if (overRenderer) { if (event.deltaY) { @@ -471,7 +472,6 @@ DAT.Globe = function(container, opts) { function unload() { running = false container.removeEventListener('mousedown', onMouseDown, false); - container.removeEventListener('mousewheel', onMouseWheel, false); if ('onwheel' in document) { container.removeEventListener('wheel', onMouseWheel, false); } else { @@ -526,7 +526,6 @@ DAT.Globe = function(container, opts) { - /* ---- plugins/Sidebar/media-globe/three.min.js ---- */ @@ -1343,4 +1342,4 @@ THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=thi THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b}; THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1}; THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;bd.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight; -f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}}; \ No newline at end of file +f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}}; diff --git a/plugins/Sidebar/media-globe/globe.js b/plugins/Sidebar/media-globe/globe.js index eab71f9e..a5523796 100644 --- a/plugins/Sidebar/media-globe/globe.js +++ b/plugins/Sidebar/media-globe/globe.js @@ -321,6 +321,7 @@ DAT.Globe = function(container, opts) { } function onMouseWheel(event) { + if (container.style.cursor != "move") return false; event.preventDefault(); if (overRenderer) { if (event.deltaY) {