mirror of https://github.com/placeAtlas/atlas.git
Prevent text selection on dragging, zooming etc
This commit is contained in:
parent
5817ac664c
commit
92fb728bef
|
@ -159,6 +159,8 @@ function init(){
|
|||
|
||||
zoomIn(e.layerX, e.layerY);
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
|
||||
|
@ -172,11 +174,14 @@ function init(){
|
|||
|
||||
zoomIn(e.layerX, e.layerY);
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
container.addEventListener("mousedown", function(e){
|
||||
lastPosition = [e.clientX, e.clientY];
|
||||
dragging = true;
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
window.addEventListener("mousemove", function(e){
|
||||
|
@ -189,12 +194,15 @@ function init(){
|
|||
zoomOrigin[1] += deltaY;
|
||||
|
||||
applyView();
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener("mouseup", function(e){
|
||||
if(dragging){
|
||||
dragging = false;
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -358,7 +358,7 @@ function initView(){
|
|||
element.entry = sortedAtlas[i];
|
||||
|
||||
element.addEventListener("mouseenter", function(e){
|
||||
if(!fixed){
|
||||
if(!fixed && !dragging){
|
||||
objectsContainer.innerHTML = "";
|
||||
zoomOrigin = [
|
||||
innerContainer.clientWidth/2 - this.entry.center[0]* zoom// + container.offsetLeft
|
||||
|
@ -378,7 +378,7 @@ function initView(){
|
|||
});
|
||||
|
||||
element.addEventListener("mouseleave", function(e){
|
||||
if(!fixed){
|
||||
if(!fixed && !dragging){
|
||||
hovered = [];
|
||||
updateLines();
|
||||
render();
|
||||
|
|
Loading…
Reference in New Issue