Commit 784c37b5 authored by Jérémie Garcia's avatar Jérémie Garcia
Browse files

bug fix

parent ff8fb1d4
......@@ -7,6 +7,20 @@ Mathematical utilities for curves processing
Traj.Utils = {
//events utilities
getStartEventName : function(){
return Traj.onmobile ? 'touchestart' : 'mousedown';
}
getMoveEventName : function(){
return Traj.onmobile ? 'touchemove' : 'mousemove';
}
getEndEventName : function(){
return Traj.onmobile ? 'toucheend' : 'mouseup';
}
ongoingTouchIndexById : function(idToFind) {
var i = 0, id;
for (i = 0; i < Traj.View.ongoingTouches.length; i++) {
......
......@@ -24,13 +24,13 @@ Traj.Events = {
handleStart : function(evt) {
Traj.State.newAction();
Traj.Events.hideContextMenu();
if (Traj.View.touchState === "wait" && evt.changedTouches.length < 2) {
if (Traj.View.touchState === 'wait' && evt.changedTouches.length < 2) {
//console.log(evt.changedTouches.length)
lastFactor = 1; // IN GLOBAL FOR NOW (used for 3 fingers event, stretch)
Traj.Events.touches = [];
if (evt.touches[1]) {Traj.Events.touchId = evt.touches[1].identifier;} // if the Zslider had been touch before the canvas
else {Traj.Events.touchId = evt.touches[0].identifier;} // canvas is touch in 1st
Traj.View.touchState = "1touch"; // set state
Traj.View.touchState = '1touch'; // set state
var touches = evt.changedTouches;
var i = 0; // take first touch of changed touches (only 1 new touch at a time)
var evt_pos = Traj.Utils.event2CanvasPos(touches[i]);
......@@ -46,16 +46,16 @@ Traj.Events = {
Traj.View.draw_startCurrentCurve(touches[i]);
} else { // CAS 1 doigt select : moved in handleEnd
Traj.Events.transformation = "1touch";
Traj.Events.transformation = '1touch';
Traj.View.traj_repaint();
Traj.Events.idSetTimeoutTransformation = setTimeout(function() {Traj.Events.isTransforming = true;},150); // 150ms for touch before translating
//Traj.Events.idSetTimeoutLongTouchMenu = setTimeout(Traj.Events.showLongTouchMenu,1200);
}
} else if (Traj.View.touchState === "1touch" || (evt.changedTouches.length == 2 && Traj.View.touchState === "wait")){
} else if (Traj.View.touchState === '1touch' || (evt.changedTouches.length == 2 && Traj.View.touchState === 'wait')){
clearTimeout(Traj.Events.idSetTimeoutTransformation); // avoid selecting another curve
Traj.Events.transformation = "2touch";
Traj.View.touchState = "2touch";
Traj.Events.transformation = '2touch';
Traj.View.touchState = '2touch';
Traj.View.traj_repaint();
Traj.Events.touches.push([evt.changedTouches[0].clientX,evt.changedTouches[0].clientY]);
......@@ -70,10 +70,10 @@ Traj.Events = {
var center = [(evt.touches[0].clientX + evt.touches[1].clientX)/2 , (evt.touches[0].clientY + evt.touches[1].clientY)/2];
Traj.Events.center2Touch = Traj.Utils.convertCanvasPosIntoUnits(center);
} else if (Traj.View.touchState === "2touch") {
Traj.Events.transformation = "3touch";
} else if (Traj.View.touchState === '2touch') {
Traj.Events.transformation = '3touch';
Traj.View.touchState = "3touch";
Traj.View.touchState = '3touch';
Traj.View.traj_repaint();
Traj.Events.touches[0] = [evt.touches[0].clientX, evt.touches[0].clientY];
Traj.Events.touches[1] = [evt.touches[1].clientX, evt.touches[1].clientY];
......@@ -86,7 +86,7 @@ Traj.Events = {
handleMove : function(evt) {
if (Traj.View.touchState === "1touch") { // CAS 1 doigt
if (Traj.View.touchState === '1touch') { // CAS 1 doigt
if (Traj.Events.drawing) { // CAS DESSIN
for (var k=0; k<evt.changedTouches.length;k++) { // pour tous les touchés
......@@ -105,7 +105,7 @@ Traj.Events = {
}
} else { // CAS TRANSLATION
if (Traj.Events.transformation == "1touch") {//Traj.Events.isTransforming) {
if (Traj.Events.transformation == '1touch') {//Traj.Events.isTransforming) {
var evt_pos = Traj.Utils.event2CanvasPos(evt.changedTouches[0]),
coords = Traj.Utils.convertCanvasPosIntoUnits(evt_pos),
lastCoords = Traj.Utils.convertCanvasPosIntoUnits(Traj.View.last_event_pos),
......@@ -118,7 +118,7 @@ Traj.Events = {
}
}
} else if (Traj.View.touchState === "2touch") { // CAS 2 doigts
} else if (Traj.View.touchState === '2touch') { // CAS 2 doigts
// See hammer recognition
clearTimeout(Traj.Events.idSetTimeoutLongTouchMenu);
......@@ -128,7 +128,7 @@ Traj.Events = {
Traj.Events.touches[0] = [evt.touches[0].clientX, evt.touches[0].clientY]; // mise à jour des points pour le dessin de la droite
Traj.Events.touches[1] = [evt.touches[1].clientX, evt.touches[1].clientY];
} else if (Traj.View.touchState === "3touch") { // CAS 3 doigts
} else if (Traj.View.touchState === '3touch') { // CAS 3 doigts
// scale / axis done with the 2 first finger
clearTimeout(Traj.Events.idSetTimeoutLongTouchMenu);
// draw line TODO : put it in a function and call it on touchstart for 2 fingers (plot it in an other canvas to avoid multiple draws)
......@@ -163,8 +163,8 @@ Traj.Events = {
}
},
handleEnd : function(evt) { // BUG POSSIBLE LORSQU"ON LACHE PLUSIEURS DOIGTS EN MÊME TEMPS (jamais arrivé pour l"instant...)
// L"iPad semble plus souvent regrouper les touchés que l"android
handleEnd : function(evt) { // BUG POSSIBLE LORSQU'ON LACHE PLUSIEURS DOIGTS EN MÊME TEMPS (jamais arrivé pour l'instant...)
// L'iPad semble plus souvent regrouper les touchés que l'android
//if (Traj.Events.drawing) {
var touches = evt.changedTouches;
var nbTouch = evt.touches.length;
......@@ -180,7 +180,7 @@ Traj.Events = {
for (var k=0; k<evt.changedTouches.length;k++) { // boucle sur tous les touchés
if (evt.changedTouches[k].identifier == Traj.Events.touchId) { // si c"est le 1e touché qui est laché (sert à ne pas prendre en compte le laché du zSlider par exemple)
if (evt.changedTouches[k].identifier == Traj.Events.touchId) { // si c'est le 1e touché qui est laché (sert à ne pas prendre en compte le laché du zSlider par exemple)
var i = 0;
var coords = Traj.Utils.convertCanvasPosIntoUnits(Traj.Utils.event2CanvasPos(touches[i]));
var z = Traj.Events.getZSliderValue()||0;
......@@ -193,7 +193,7 @@ Traj.Events = {
Traj.Manager.processModifyCurve(coords[0], coords[1], z, t); // cas "redraw"
}
}
Traj.View.touchState = "wait";
Traj.View.touchState = 'wait';
if (Traj.Events.isTransforming) { // CAS TRANSFORMATION
Traj.Events.isTransforming = false;
......@@ -202,14 +202,14 @@ Traj.Events = {
Traj.View.dyn_repaint();
}
} else if (Traj.View.touchState === "1touch") { // 1 doigt => passage à 0 doigt
} else if (Traj.View.touchState === '1touch') { // 1 doigt => passage à 0 doigt
Traj.Events.transformation = null;
Traj.View.touchState = "wait";
Traj.View.touchState = 'wait';
Traj.View.dyn_repaint();
} else if (Traj.View.touchState === "2touch") { // 2 doigt => passage à 1 doigt
Traj.View.touchState = "1touch";
} else if (Traj.View.touchState === "3touch") { // 3 doigt => passage à 2 doigt
Traj.View.touchState = "2touch";
} else if (Traj.View.touchState === '2touch') { // 2 doigt => passage à 1 doigt
Traj.View.touchState = '1touch';
} else if (Traj.View.touchState === '3touch') { // 3 doigt => passage à 2 doigt
Traj.View.touchState = '2touch';
}
}
Traj.View.traj_repaint();
......@@ -222,7 +222,7 @@ Traj.Events = {
//}
},
handleCancel : function(evt) { // prévoir ce cas comme celui d"un touchEnd ?
handleCancel : function(evt) { // prévoir ce cas comme celui d'un touchEnd ?
evt.preventDefault();
},
......@@ -243,8 +243,8 @@ Traj.Events = {
handleMouseDown : function(evt) {
if (Traj.View.touchState === "wait") {
Traj.View.touchState = "1touch";
if (Traj.View.touchState === 'wait') {
Traj.View.touchState = '1touch';
var evt_pos = Traj.Utils.event2CanvasPos(evt);
var coords = Traj.Utils.convertCanvasPosIntoUnits(evt_pos);
var z = 0;
......@@ -256,7 +256,7 @@ Traj.Events = {
},
handleMouseMove : function(evt) {
if (Traj.View.touchState === "1touch") {
if (Traj.View.touchState === '1touch') {
var evt_pos = Traj.Utils.event2CanvasPos(evt);
if (Traj.Manager.currentCurve !== null && Traj.Utils.distanceBtwPoints(evt_pos, Traj.View.last_event_pos) > Traj.View.DISTANCE_TRESHOLD) {
var coords = Traj.Utils.convertCanvasPosIntoUnits(evt_pos);
......@@ -278,7 +278,7 @@ Traj.Events = {
} else if (Traj.Events.rangeSlider) {
Traj.Manager.processModifyCurve(coords[0], coords[1], z, t); // cas "redraw"
}
Traj.View.touchState = "wait";
Traj.View.touchState = 'wait';
//"draw_updateCurrentCurve(evt);
},
......@@ -287,8 +287,8 @@ Traj.Events = {
canvas.addEventListener("touchend", Traj.Events.handleEnd, false);
canvas.addEventListener("touchcancel", Traj.Events.handleCancel, false);
canvas.addEventListener("touchmove", Traj.Events.handleMove, false);
canvas.addEventListener("touchstart",Traj.Events.handleStartLongTouch,false);
canvas.addEventListener("touchmove",Traj.Events.handleMoveLongTouch,false);
canvas.addEventListener('touchstart',Traj.Events.handleStartLongTouch,false);
canvas.addEventListener('touchmove',Traj.Events.handleMoveLongTouch,false);
},
addMouseEvents : function(canvas) {
......@@ -326,7 +326,7 @@ Traj.Events = {
} else {
Traj.Events.addMouseEvents(Traj.View.dyn_canvas);
// hide draw zone
var drawZone = document.getElementById("drawZone");
var drawZone = document.getElementById('drawZone');
drawZone.style.display="none";
}
......@@ -350,16 +350,20 @@ Traj.Events = {
Traj.Events.addPlayPauseEvent();
},
///////////////////////////////////////////////////////////////////
/////////////////////////// SLIDERS EVENT /////////////////////////
///////////////////////////////////////////////////////////////////
initSlider : function(range){
// initialisation : on supprime l"ancien slider et on le remet
$("#slider-div").remove();
$("body").append("<div class="canvas-bot-overlay" id="slider-div" style:"position:absolute, bottom:100"> </div>");
$("#slider-div").append("<input class="timeSlider" value="0" />");
// initialisation : on supprime l'ancien slider et on le remet
$('#slider-div').remove();
$('body').append('<div class="canvas-bot-overlay" id="slider-div" style:"position:absolute, bottom:100"> </div>');
$('#slider-div').append('<input class="timeSlider" value="0" />');
// définitions de paramètres
var width = Math.round(0.9*(window.innerWidth - 100));
......@@ -372,12 +376,12 @@ Traj.Events = {
}
// déclaration du slider (plugin jquery.range.js)
$(".timeSlider").jRange({
$('.timeSlider').jRange({
from: 0,
to: maxTime,
step: 1,
scale: [0,maxTime],
format: "%s ms",
format: '%s ms',
width: width,
showLabels: true,
isRange : range, // true pour le range slider
......@@ -385,11 +389,11 @@ Traj.Events = {
isVertical: false,
});
Traj.Events.timeSlider = $(".timeSlider").data("plugin_jRange"); // actualiser la variable du slider
Traj.Events.rangeSlider = range; // true si c"est un range slider
if (range) {this.setSliderValue("0,100")}
Traj.Events.timeSlider = $('.timeSlider').data('plugin_jRange'); // actualiser la variable du slider
Traj.Events.rangeSlider = range; // true si c'est un range slider
if (range) {this.setSliderValue('0,100')}
if (document.getElementById("flip-timeSlider").value == "on") {
if (document.getElementById("flip-timeSlider").value == 'on') {
$("#slider-div").show();
} else {
$("#slider-div").hide();
......@@ -406,7 +410,7 @@ Traj.Events = {
getSliderValue : function() {
var slider = Traj.Events.timeSlider;
if (Traj.Events.rangeSlider) {
var value = slider.getValue().split(",");
var value = slider.getValue().split(',');
var values = [Number(value[0]),Number(value[1])];
return values;
} else {
......@@ -432,19 +436,19 @@ Traj.Events = {
initZSlider : function() { // initialisation du zSlider (isVertical is set to true)
var width = Math.round(0.9*(window.innerHeight - 150));
$(".ZSlider").jRange({
$('.ZSlider').jRange({
from: 5,
to: -5,
step: 0.1,
scale: [5,-5],
format: "%s",
format: '%s',
width: width,
showLabels: true,
isRange : false,
isVertical: true,
onstatechange : Traj.Events.zsliderOnChange,
});
Traj.Events.zSlider = $(".ZSlider").data("plugin_jRange");
Traj.Events.zSlider = $('.ZSlider').data('plugin_jRange');
$("#ZSliderDiv").hide();
},
......@@ -523,14 +527,14 @@ Traj.Events = {
Traj.View.dyn_repaint();
}
// le premier passage dans la fonction remet les valeurs de scale et angle à leur valeurs initiales et passe isTransforming à "true"
// le premier passage dans la fonction remet les valeurs de scale et angle à leur valeurs initiales et passe isTransforming à 'true'
Traj.Events.isTransforming = true;
});
},
addSessionButtonEvents : function() {
var eventname = Traj.mobile ? "touchstart" : "mousedown",
sessionDivOverCanvas = $("#sessionDivOverCanvas"),
sessionDivOverCanvas = $('#sessionDivOverCanvas'),
sessionDiv = document.getElementById("lblCurrentSession");
sessionDivOverCanvas.hide();
......@@ -577,9 +581,9 @@ Traj.Events = {
}
};
var buttonCurveMenuPressed = function(button) {
var colorGrey = "#ECEDEE",
colorBlack = "#666666",
colorWhite = "#FBFBFB",
var colorGrey = '#ECEDEE',
colorBlack = '#666666',
colorWhite = '#FBFBFB',
divCurveAction = $("#divCurveAction"),
divCurveProp = $("#divCurveProp"),
divCurveMulti = $("#divCurveMulti"),
......@@ -587,39 +591,39 @@ Traj.Events = {
prop = $("#prop"),
multi = $("#multi");
if (button == "action") {
//console.log("action");
if (button == 'action') {
//console.log('action');
divCurveAction.show();
action.css("background-color",colorGrey); // passer en code natif
action.css("border-bottom-color",colorGrey);
action.css('background-color',colorGrey); // passer en code natif
action.css('border-bottom-color',colorGrey);
divCurveProp.hide();
prop.css("background-color",colorWhite);
prop.css("border-bottom-color",colorBlack);
prop.css('background-color',colorWhite);
prop.css('border-bottom-color',colorBlack);
divCurveMulti.hide();
multi.css("background-color",colorWhite);
multi.css("border-bottom-color",colorBlack);
} else if (button == "prop") {
//console.log("prop");
multi.css('background-color',colorWhite);
multi.css('border-bottom-color',colorBlack);
} else if (button == 'prop') {
//console.log('prop');
divCurveAction.hide();
action.css("background-color",colorWhite);
action.css("border-bottom-color",colorBlack);
action.css('background-color',colorWhite);
action.css('border-bottom-color',colorBlack);
divCurveProp.show();
prop.css("background-color",colorGrey);
prop.css("border-bottom-color",colorGrey);
prop.css('background-color',colorGrey);
prop.css('border-bottom-color',colorGrey);
divCurveMulti.hide();
multi.css("background-color",colorWhite);
multi.css("border-bottom-color",colorBlack);
} else if (button == "multi") {
//console.log("multi");
multi.css('background-color',colorWhite);
multi.css('border-bottom-color',colorBlack);
} else if (button == 'multi') {
//console.log('multi');
divCurveAction.hide();
action.css("background-color",colorWhite);
action.css("border-bottom-color",colorBlack);
action.css('background-color',colorWhite);
action.css('border-bottom-color',colorBlack);
divCurveProp.hide();
prop.css("background-color",colorWhite);
prop.css("border-bottom-color",colorBlack);
prop.css('background-color',colorWhite);
prop.css('border-bottom-color',colorBlack);
divCurveMulti.show();
multi.css("background-color",colorGrey);
multi.css("border-bottom-color",colorGrey);
multi.css('background-color',colorGrey);
multi.css('border-bottom-color',colorGrey);
}
};
......@@ -636,11 +640,11 @@ Traj.Events = {
Traj.View.dyn_canvas.addEventListener("mousedown",closeMenu ,false);
}
$("#action").on("click",function() {buttonCurveMenuPressed("action");});
$("#prop").on("click",function() {buttonCurveMenuPressed("prop");});
$("#multi").on("click",function() {buttonCurveMenuPressed("multi");});
$('#action').on('click',function() {buttonCurveMenuPressed('action');});
$('#prop').on('click',function() {buttonCurveMenuPressed('prop');});
$('#multi').on('click',function() {buttonCurveMenuPressed('multi');});
buttonCurveMenuPressed("action");
buttonCurveMenuPressed('action');
},
......@@ -649,22 +653,22 @@ Traj.Events = {
var curve = Traj.Manager.trajectories[index];
if (Traj.Manager.trajectories[index]) {
// time info
var timeNumber = document.getElementById("timeStretch");
var timeNumber = document.getElementById('timeStretch');
timeNumber.value = curve.lengthTime();
// position first point
var xOriPosBox = document.getElementById("xOriPos");
var yOriPosBox = document.getElementById("yOriPos");
var zOriPosBox = document.getElementById("zOriPos");
var xOriPosBox = document.getElementById('xOriPos');
var yOriPosBox = document.getElementById('yOriPos');
var zOriPosBox = document.getElementById('zOriPos');
xOriPosBox.value = curve.X[0].toFixed(2);
yOriPosBox.value = curve.Y[0].toFixed(2);
zOriPosBox.value = curve.Z[0].toFixed(2);
// source number and multiplay
document.getElementById("sourceControled").value = curve.sourceNumber;
$("#checkPlay").prop("checked", curve.multiPlay).checkboxradio("refresh");
$("#checkPlay").prop('checked', curve.multiPlay).checkboxradio("refresh");
Traj.Events.selectSourceButton(curve.sourceNumber);
} else {
document.getElementById("sourceControled").value = 1;
$("#checkPlay").prop("checked", false).checkboxradio("refresh");
$("#checkPlay").prop('checked', false).checkboxradio("refresh");
}
},
......@@ -705,23 +709,22 @@ Traj.Events = {
var rotateLeft = document.getElementById("rotateLeft");
var rotateRight = document.getElementById("rotateRight");
if (Traj.onmobile) {
rotateLeft.addEventListener("touchstart", startRotateLeft, false);
rotateLeft.addEventListener("touchend", endRotateLeft, false);
rotateRight.addEventListener("touchstart", startRotateRight, false);
rotateRight.addEventListener("touchend", endRotateRight, false);
rotateLeft.addEventListener('touchstart', startRotateLeft, false);
rotateLeft.addEventListener('touchend', endRotateLeft, false);
rotateRight.addEventListener('touchstart', startRotateRight, false);
rotateRight.addEventListener('touchend', endRotateRight, false);
} else {
rotateLeft.addEventListener("mousedown", startRotateLeft, false);
rotateLeft.addEventListener("mouseup", endRotateLeft, false);
rotateRight.addEventListener("mousedown", startRotateRight, false);
rotateRight.addEventListener("mouseup", endRotateRight, false);
rotateLeft.addEventListener('mousedown', startRotateLeft, false);
rotateLeft.addEventListener('mouseup', endRotateLeft, false);
rotateRight.addEventListener('mousedown', startRotateRight, false);
rotateRight.addEventListener('mouseup', endRotateRight, false);
}
},
addSourceButtonEvent : function() { // evt for source buttons
var buttons = document.getElementsByClassName("sourceButton"),
event_name = Traj.onmobile ? "touchestart" : "mousedown";
var buttons = document.getElementsByClassName('sourceButton'),
startr_event_name = Traj.Util.getStartEventName();
var selectSource = function(source) {
Traj.Events.selectSourceButton(source);
......@@ -740,19 +743,19 @@ Traj.Events = {
for (var k=0;k<buttons.length;k++) {
buttons[k].children[0].style.background=Traj.View.default_colors[k];
buttons[k].addEventListener(event_name, selectSource.bind(null,k+1));
buttons[k].addEventListener(start_=event_name, selectSource.bind(null,k+1));
}
},
addDrawZoneEvent : function() { // evt for bi-manual use for drawing
var drawZone = document.getElementById("drawZoneEl");
var drawZoneImg = document.getElementById("drawZoneImg");
var drawZoneDiv = document.getElementById("drawZone");
var drawZone = document.getElementById('drawZoneEl');
var drawZoneImg = document.getElementById('drawZoneImg');
var drawZoneDiv = document.getElementById('drawZone');
var handleStart = function(evt) {
evt.preventDefault();
//console.log("draw zone touched");
//console.log('draw zone touched');
$("#slider-div").hide();
$(".canvas-left-overlay").hide();
$("#divCurveMenu").hide();
......@@ -771,31 +774,31 @@ Traj.Events = {
var currentSource = curve.sourceNumber;
Traj.Events.selectSourceButton(currentSource);
}
if (Traj.View.touchState == "wait") { // if we have not started to draw
if (Traj.View.touchState == 'wait') { // if we have not started to draw
Traj.Events.drawing = false;
}
};
drawZone.addEventListener("touchstart",handleStart,false);
drawZoneImg.addEventListener("touchstart",handleStart,false);
drawZone.addEventListener("touchend",handleEnd,false);
drawZoneImg.addEventListener("touchend",handleEnd,false);
drawZone.addEventListener('touchstart',handleStart,false);
drawZoneImg.addEventListener('touchstart',handleStart,false);
drawZone.addEventListener('touchend',handleEnd,false);
drawZoneImg.addEventListener('touchend',handleEnd,false);
// initialisation
$(".buttonSource").hide();
$(".buttonSource").css("background-color","white");
$(".buttonSource").css('background-color','white');
},
selectSourceButton : function(sourceNumber) { // change the apparence of the sources buttons
var buttons = document.getElementsByClassName("sourceButton");
var buttons = document.getElementsByClassName('sourceButton');
for (var k=0;k<buttons.length;k++) {
buttons[k].style.background="transparent";
buttons[k].style.borderColor="transparent";
buttons[k].style.background='transparent';
buttons[k].style.borderColor='transparent';
}
if (sourceNumber<9) {
buttons[sourceNumber-1].style.background = Traj.View.default_colors[sourceNumber-1];
buttons[sourceNumber-1].style.borderColor = "black";//Traj.View.default_colors[sourceNumber-1];
buttons[sourceNumber-1].style.borderColor = 'black';//Traj.View.default_colors[sourceNumber-1];
}
},
......@@ -805,8 +808,8 @@ Traj.Events = {
divMenu.style.visibility = "hidden";
divMenu.style.zIndex = 4;
var circularButton = document.getElementById("circularButton"),
concatButton = document.getElementById("concatButton");
var circularButton = document.getElementById('circularButton'),
concatButton = document.getElementById('concatButton');
handleTouchCircular = function() {
Traj.Manager.processMakeCircular();
Traj.Events.hideContextMenu();
......@@ -824,18 +827,21 @@ Traj.Events = {
}
};
if (Traj.onmobile) {
circularButton.addEventListener("touchstart",handleTouchCircular,false);
concatButton.addEventListener("touchstart",handleTouchConcat,false);
circularButton.addEventListener('touchstart',handleTouchCircular,false);
concatButton.addEventListener('touchstart',handleTouchConcat,false);
} else {
circularButton.addEventListener("mousedown",handleTouchCircular,false);
concatButton.addEventListener("mousedown",handleTouchConcat,false);
circularButton.addEventListener('mousedown',handleTouchCircular,false);
concatButton.addEventListener('mousedown',handleTouchConcat,false);
}
},
hideContextMenu : function() {
var divMenu = document.getElementById("contextMenu");
divMenu.style.visibility = "hidden";
},
showContextMenu : function() {
//two boolean to show or not the contextual menu
showContextMenu : function(circular, concat) {
if(circular||concat){
var curve = Traj.Manager.trajectories[Traj.Manager.currentCurveIndex];
var pos = Traj.Utils.convertUnitsIntoCanvasPos([curve.X[curve.X.length-1],curve.Y[curve.X.length-1]]);
var divMenu = document.getElementById("contextMenu");
......@@ -843,9 +849,9 @@ Traj.Events = {
divMenu.style.top = pos[1] + "px";
divMenu.style.visibility = "visible";
setTimeout(Traj.Events.hideContextMenu,5000);
}