fixe corpus map popup appering when mouse was not over the map
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
// var _particules = [];
|
// var _particules = [];
|
||||||
// var _base_radius = 3; // nodes radius (real radius, not diametre)
|
// var _base_radius = 3; // nodes radius (real radius, not diametre)
|
||||||
var _p_velocity_factor = 0.5;
|
var _p_velocity_factor = 0.5;
|
||||||
|
var _mouse_in = true;
|
||||||
var _m_pos = {x:0, y:0};
|
var _m_pos = {x:0, y:0};
|
||||||
var _node_hover_id = -1;
|
var _node_hover_id = -1;
|
||||||
var _node_opened_id = -1;
|
var _node_opened_id = -1;
|
||||||
@@ -295,7 +296,7 @@
|
|||||||
this.checkWallBouncing();
|
this.checkWallBouncing();
|
||||||
this.updatePos();
|
this.updatePos();
|
||||||
}
|
}
|
||||||
if(!this.aside)
|
if(_mouse_in && !this.aside)
|
||||||
this.checkMouse();
|
this.checkMouse();
|
||||||
|
|
||||||
// if(this.debug)
|
// if(this.debug)
|
||||||
@@ -618,12 +619,17 @@
|
|||||||
_$canvas
|
_$canvas
|
||||||
.on('mousemove', function(event) {
|
.on('mousemove', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
// console.log("onMouseMove");
|
|
||||||
_m_pos.x = event.originalEvent.clientX;
|
_m_pos.x = event.originalEvent.clientX;
|
||||||
_m_pos.y = event.originalEvent.clientY;
|
_m_pos.y = event.originalEvent.clientY;
|
||||||
// console.log("/ _ / - / _ /");
|
})
|
||||||
// console.log("Node pos: ", {x:_nodes[0].x, y:_nodes[0].y});
|
.on('mouseenter', function(event){
|
||||||
// console.log("Mouse pos: ", {x:_m_pos.x, y:_m_pos.y});
|
// console.log('onMouseIN');
|
||||||
|
_mouse_in = true;
|
||||||
|
})
|
||||||
|
.on('mouseout', function(event){
|
||||||
|
// console.log('onMouseOUT');
|
||||||
|
_mouse_in = false;
|
||||||
|
_node_pop_up.removeNode();
|
||||||
})
|
})
|
||||||
.on('click', function(event) {
|
.on('click', function(event) {
|
||||||
if(event.target.tagName != "A" && event.target.tagName != "INPUT"){
|
if(event.target.tagName != "A" && event.target.tagName != "INPUT"){
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
// var _particules = [];
|
// var _particules = [];
|
||||||
// var _base_radius = 3; // nodes radius (real radius, not diametre)
|
// var _base_radius = 3; // nodes radius (real radius, not diametre)
|
||||||
var _p_velocity_factor = 0.5;
|
var _p_velocity_factor = 0.5;
|
||||||
|
var _mouse_in = true;
|
||||||
var _m_pos = {x:0, y:0};
|
var _m_pos = {x:0, y:0};
|
||||||
var _node_hover_id = -1;
|
var _node_hover_id = -1;
|
||||||
var _node_opened_id = -1;
|
var _node_opened_id = -1;
|
||||||
@@ -295,7 +296,7 @@
|
|||||||
this.checkWallBouncing();
|
this.checkWallBouncing();
|
||||||
this.updatePos();
|
this.updatePos();
|
||||||
}
|
}
|
||||||
if(!this.aside)
|
if(_mouse_in && !this.aside)
|
||||||
this.checkMouse();
|
this.checkMouse();
|
||||||
|
|
||||||
// if(this.debug)
|
// if(this.debug)
|
||||||
@@ -618,12 +619,17 @@
|
|||||||
_$canvas
|
_$canvas
|
||||||
.on('mousemove', function(event) {
|
.on('mousemove', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
// console.log("onMouseMove");
|
|
||||||
_m_pos.x = event.originalEvent.clientX;
|
_m_pos.x = event.originalEvent.clientX;
|
||||||
_m_pos.y = event.originalEvent.clientY;
|
_m_pos.y = event.originalEvent.clientY;
|
||||||
// console.log("/ _ / - / _ /");
|
})
|
||||||
// console.log("Node pos: ", {x:_nodes[0].x, y:_nodes[0].y});
|
.on('mouseenter', function(event){
|
||||||
// console.log("Mouse pos: ", {x:_m_pos.x, y:_m_pos.y});
|
// console.log('onMouseIN');
|
||||||
|
_mouse_in = true;
|
||||||
|
})
|
||||||
|
.on('mouseout', function(event){
|
||||||
|
// console.log('onMouseOUT');
|
||||||
|
_mouse_in = false;
|
||||||
|
_node_pop_up.removeNode();
|
||||||
})
|
})
|
||||||
.on('click', function(event) {
|
.on('click', function(event) {
|
||||||
if(event.target.tagName != "A" && event.target.tagName != "INPUT"){
|
if(event.target.tagName != "A" && event.target.tagName != "INPUT"){
|
||||||
|
|||||||
Reference in New Issue
Block a user