Commit 7c0f1f6a authored by Matthias Möller's avatar Matthias Möller

triggered event successfully

parent ab642a37
......@@ -26,21 +26,34 @@ export default Ember.Service.extend({
myMessageHandler: function(event){
let data = event.data;
let canvas = $("threeCanvas");
console.log(canvas);
console.log(data);
data = JSON.parse(data);
let mentalCommand = data[mentalCommand];
//MentalCommand is a push
if(mentalCommand === 2){
this.triggerZoom(-0.5);
//MentalCommand is a pull
}else if(mentalCommand === 4){
this.triggerZoom(0.5);
}
},
myCloseHandler: function(event){
Ember.run.later(this, function(){this.set("status", "disconnected")}, 1000);
},
triggerZoom(){
let canvas = $("threeCanvas");
console.log(canvas);
if(Ember.isPresent(canvas)){
Ember.sendEvent(canvas, "mousewheel");
}
triggerZoom(wheelDelta){
let canvas = $("#threeCanvas")[0];
let event = new Event("mousewheel",
{
"bubbles":true,
"cancelable":false
});
event.clientX = canvas.clientX;
event.clientY = canvas.clientY;
event.wheelDelta = wheelDelta;
canvas.dispatchEvent(event);
}
});
......@@ -10,7 +10,7 @@
100%{color: grey;}
}
nav.navbar-nav > li > a.connected{
.nav.navbar-nav > li > a.connected{
color: #7FFF00;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment