commit
6442712e0c
@ -388,7 +388,7 @@ editor.prototype.HTMLescape = function (str_) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
editor.prototype.listen = function () {
|
editor.prototype.listen = function () {
|
||||||
|
var eui=document.getElementById('eui');
|
||||||
var uc = eui.getContext('2d');
|
var uc = eui.getContext('2d');
|
||||||
|
|
||||||
function fillPos(pos) {
|
function fillPos(pos) {
|
||||||
@ -399,9 +399,11 @@ editor.prototype.listen = function () {
|
|||||||
function eToLoc(e) {
|
function eToLoc(e) {
|
||||||
var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft
|
var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft
|
||||||
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop
|
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop
|
||||||
|
var xx=e.clientX,yy=e.clientY
|
||||||
|
if(editor.isMobile){xx=e.touches[0].clientX,yy=e.touches[0].clientY}
|
||||||
editor.loc = {
|
editor.loc = {
|
||||||
'x': scrollLeft + e.clientX - mid.offsetLeft - mapEdit.offsetLeft,
|
'x': scrollLeft + xx - mid.offsetLeft - mapEdit.offsetLeft,
|
||||||
'y': scrollTop + e.clientY - mid.offsetTop - mapEdit.offsetTop,
|
'y': scrollTop + yy - mid.offsetTop - mapEdit.offsetTop,
|
||||||
'size': editor.isMobile?(32*innerWidth*0.96/416):32
|
'size': editor.isMobile?(32*innerWidth*0.96/416):32
|
||||||
};
|
};
|
||||||
return editor.loc;
|
return editor.loc;
|
||||||
@ -499,7 +501,6 @@ editor.prototype.listen = function () {
|
|||||||
}
|
}
|
||||||
holdingPath = 0;
|
holdingPath = 0;
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
var loc = eToLoc(e);
|
|
||||||
if (stepPostfix && stepPostfix.length) {
|
if (stepPostfix && stepPostfix.length) {
|
||||||
preMapData = JSON.parse(JSON.stringify(editor.map));
|
preMapData = JSON.parse(JSON.stringify(editor.map));
|
||||||
currDrawData.pos = JSON.parse(JSON.stringify(stepPostfix));
|
currDrawData.pos = JSON.parse(JSON.stringify(stepPostfix));
|
||||||
|
|||||||
@ -118,13 +118,20 @@ editor_mode = function (editor) {
|
|||||||
printe(field + ' : 输入的值不合要求,请鼠标放置在注释上查看说明');
|
printe(field + ' : 输入的值不合要求,请鼠标放置在注释上查看说明');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
input.ondblclick = function () {
|
var dblclickfunc=function () {
|
||||||
if (cobj._type === 'event') editor_blockly.import(guid, {type: cobj._event});
|
if (cobj._type === 'event') editor_blockly.import(guid, {type: cobj._event});
|
||||||
if (cobj._type === 'textarea') editor_multi.import(guid, {lint: cobj._lint, string: cobj._string});
|
if (cobj._type === 'textarea') editor_multi.import(guid, {lint: cobj._lint, string: cobj._string});
|
||||||
}
|
}
|
||||||
// thisTr.onclick = function(){
|
input.ondblclick = dblclickfunc
|
||||||
// editor.lastClickId=guid;
|
var doubleClickCheck=[0];
|
||||||
// }
|
thisTr.onclick = function(){
|
||||||
|
var newClick = new Date().getTime();
|
||||||
|
var lastClick = doubleClickCheck.shift();
|
||||||
|
doubleClickCheck.push(newClick);
|
||||||
|
if(newClick-lastClick<500){
|
||||||
|
dblclickfunc()
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return {"HTML": outstr.join(''), "guids": guids, "listen": listen};
|
return {"HTML": outstr.join(''), "guids": guids, "listen": listen};
|
||||||
|
|||||||
@ -503,10 +503,20 @@ var editor_mobile_listen=function(){
|
|||||||
printf(info[0].children[1].getAttribute('title'))
|
printf(info[0].children[1].getAttribute('title'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=====
|
||||||
|
|
||||||
document.body.ontouchstart=document.body.onmousedown;
|
document.body.ontouchstart=document.body.onmousedown;
|
||||||
document.body.onmousedown=null;
|
document.body.onmousedown=null;
|
||||||
|
|
||||||
//=====
|
|
||||||
|
var eui=document.getElementById('eui');
|
||||||
|
eui.ontouchstart=eui.onmousedown
|
||||||
|
eui.onmousedown=null
|
||||||
|
eui.ontouchmove=eui.onmousemove
|
||||||
|
eui.onmousemove=null
|
||||||
|
eui.ontouchend=eui.onmouseup
|
||||||
|
eui.onmouseup=null
|
||||||
|
|
||||||
|
|
||||||
var chooseThis = document.getElementById('chooseThis');
|
var chooseThis = document.getElementById('chooseThis');
|
||||||
chooseThis.ontouchstart=chooseThis.onmousedown
|
chooseThis.ontouchstart=chooseThis.onmousedown
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user