diff --git a/_server/css/editor_mobile.css b/_server/css/editor_mobile.css index 571653c1..db75764b 100644 --- a/_server/css/editor_mobile.css +++ b/_server/css/editor_mobile.css @@ -203,8 +203,8 @@ body { #iconLib { position: absolute; - width: 435px; - height: 620px; + width: 100vmin; + height: 100vmin; left: 5px; top: 5px; overflow: auto; @@ -349,21 +349,21 @@ table.row td { border-style: solid; border-width: 1px; cursor: default; - font: normal 13px Arial, sans-serif; + font: normal 2.5vmin Arial, sans-serif; margin: 0; outline: none; padding: 4px 0; - position: absolute; overflow-y: auto; overflow-x: hidden; max-height: 100%; + max-width: 40%; z-index: 101; border-radius: 4px; } #midMenu .menuitem{ color: #000; - font: normal 13px Arial, sans-serif; + font: normal 2.5vmin Arial, sans-serif; list-style: none; margin: 0; padding: 4px 7em 4px 28px; @@ -383,7 +383,7 @@ table.row td { } #midMenu .menuitem-content{ color: #000; - font: normal 13px Arial, sans-serif; + font: normal 2.5vmin Arial, sans-serif; } /* for vue dom */ diff --git a/_server/css/editor_mode_mobile.css b/_server/css/editor_mode_mobile.css index 392066da..c8e9fc4c 100644 --- a/_server/css/editor_mode_mobile.css +++ b/_server/css/editor_mode_mobile.css @@ -10,7 +10,7 @@ .leftTab { overflow: auto; position: absolute; - height: 630px; + height: 100vmin; } .leftTab > * { @@ -26,9 +26,9 @@ } .leftTab { - left: 5px; - top: 10px; - width: 435px; + left: 0; + top: 0; + width: 100vmin; } .leftTab .leftTabHeader { @@ -49,8 +49,8 @@ } #left6 { - left: 5px; - top: 5px; + left: 0; + top: 0; z-index: 200; position: fixed; background-color: rgb(245, 245, 245); @@ -58,11 +58,16 @@ height: 100%; overflow: hidden; } +#left6 h3{ + font-size: 3vmax; + margin: 2vmax 0; + +} #left6 #blocklyArea { - float: left; - width: 60%; - height: 95%; + + width: 100vmin; + height: 55vmax; } #left6 #blocklyDiv { @@ -71,9 +76,9 @@ #left6 .CodeMirror { border: 1px solid #eee; - float: left; - height: 95%; - width: 35%; + + height: 27vmax; + width: 100%; } #left6 #codeArea { @@ -84,8 +89,8 @@ #left7 { /* height: 440px; width: 375px;float:left; */ - left: 5px; - top: 5px; + left: 0; + top: 0; z-index: 200; position: fixed; background-color: rgb(245, 245, 245); diff --git a/_server/editor.js b/_server/editor.js index ebbbd889..9485a60a 100644 --- a/_server/editor.js +++ b/_server/editor.js @@ -402,7 +402,7 @@ editor.prototype.listen = function () { editor.loc = { 'x': scrollLeft + e.clientX - mid.offsetLeft - mapEdit.offsetLeft, 'y': scrollTop + e.clientY - mid.offsetTop - mapEdit.offsetTop, - 'size': 32 + 'size': editor.isMobile?(32*innerWidth*0.96/416):32 }; return editor.loc; }//返回可用的组件内坐标 @@ -444,8 +444,10 @@ editor.prototype.listen = function () { editor_mode.onmode('loc'); //editor_mode.loc(); //tip.whichShow = 1; + if(editor.isMobile)editor.showMidMenu(e.clientX,e.clientY); return; } + holdingPath = 1; mouseOutCheck = 2; @@ -674,6 +676,7 @@ editor.prototype.listen = function () { var locStr='('+editor.lastRightButtonPos[1].x+','+editor.lastRightButtonPos[1].y+')'; var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft; var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; + chooseThis.children[0].innerHTML='选中此点'+'('+editor.pos.x+','+editor.pos.y+')' copyLoc.children[0].innerHTML='复制事件'+locStr+'到此处'; moveLoc.children[0].innerHTML='交换事件'+locStr+'与此事件的位置'; midMenu.style='top:'+(y+scrollTop)+'px;left:'+(x+scrollLeft)+'px;'; @@ -685,8 +688,7 @@ editor.prototype.listen = function () { editor.hideMidMenu(); e.stopPropagation(); selectBox.isSelected = false; - var loc = eToLoc(e); - var pos = locToPos(loc); + editor_mode.onmode('nextChange'); editor_mode.onmode('loc'); //editor_mode.loc(); diff --git a/_server/editor_mode.js b/_server/editor_mode.js index 8b263262..c35d9cd1 100644 --- a/_server/editor_mode.js +++ b/_server/editor_mode.js @@ -121,7 +121,9 @@ editor_mode = function (editor) { input.ondblclick = function () { 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}); - + } + thisTr.onclick = function(){ + editor.lastClickId=guid; } }); } diff --git a/_server/vm.js b/_server/vm.js index e23fd65d..82b3139d 100644 --- a/_server/vm.js +++ b/_server/vm.js @@ -1,19 +1,19 @@ // vue 相关处理 - document.body.onmousedown = function (e) { //console.log(e); - var eid = []; + + var clickpath = []; e.path.forEach(function (node) { if (!node.getAttribute) return; var id_ = node.getAttribute('id'); if (id_) { - if (['left', 'left1', 'left2', 'left3', 'left4', 'left5', 'left8'].indexOf(id_) !== -1) eid.push('edit'); - eid.push(id_); + if (['left', 'left1', 'left2', 'left3', 'left4', 'left5', 'left8', 'mobileview'].indexOf(id_) !== -1) clickpath.push('edit'); + clickpath.push(id_); } }); - //console.log(eid); - if (eid.indexOf('edit') === -1) { - if (eid.indexOf('tip') === -1) { + + if (clickpath.indexOf('edit') === -1 && clickpath.indexOf('tip') === -1) { + if (clickpath.indexOf('eui') === -1) { if (selectBox.isSelected) { editor_mode.onmode(''); editor.file.saveFloorFile(function (err) { @@ -25,13 +25,17 @@ document.body.onmousedown = function (e) { }); } selectBox.isSelected = false; + editor.info = {}; } } //editor.mode.onmode(''); - editor.info = {}; - if (e.button!=2){ + if (e.button!=2 && !editor.isMobile){ editor.hideMidMenu(); } + if (clickpath.indexOf('down') !== -1 && editor.isMobile){ + editor.hideMidMenu(); + } + if(clickpath.length>=2 && clickpath[0].indexOf('id_')===0){editor.lastClickId=clickpath[0]} } iconLib.onmousedown = function (e) { e.stopPropagation(); diff --git a/editor-mobile.html b/editor-mobile.html index b0a18d1e..8fb7d599 100644 --- a/editor-mobile.html +++ b/editor-mobile.html @@ -2,6 +2,7 @@
+ @@ -9,8 +10,7 @@