fixing and cleaning
This commit is contained in:
@@ -91,8 +91,17 @@ export default {
|
||||
console.log(`canvas_w: ${canvas_w}, canvas_h: ${canvas_h}`);
|
||||
|
||||
this.paper = paper.setup(this.canvasMap.canvas);
|
||||
// console.log('this.canvasMap.paper', this.canvasMap.paper);
|
||||
this.canvasMap.canvas.addEventListener('click', this.onCanvasClick);
|
||||
// // use the paper.view click to get back if no items is clicked
|
||||
this.paper.view.onClick = function(event) {
|
||||
console.log("view onClick", this, event.target);
|
||||
if(event.target._id === "paper-view-0") {
|
||||
this.resetConcernementOpened();
|
||||
this.$router.push({
|
||||
name: 'home',
|
||||
hash: `#${this.map_mode}`
|
||||
});
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
// MATTER
|
||||
let wall_w = 100;
|
||||
@@ -122,17 +131,6 @@ export default {
|
||||
Matter.Engine.update(this.engine, 1);
|
||||
window.requestAnimationFrame(this.animate);
|
||||
},
|
||||
onCanvasClick(event){
|
||||
// console.log('onCanvasClick');
|
||||
// use the canvas click to get back if no items is mousover
|
||||
if (!this.hover_elmt) {
|
||||
this.resetConcernementOpened();
|
||||
this.$router.push({
|
||||
name: 'home',
|
||||
hash: `#${this.map_mode}`
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeUpdate () {
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user