diff --git a/js/kiri.js b/js/kiri.js index 377c77c5..5d115381 100644 --- a/js/kiri.js +++ b/js/kiri.js @@ -746,9 +746,13 @@ self.kiri.license = exports.LICENSE; } function showSlice(index, range, layer) { - return range ? - (index <= layer && index > layer-range) : (index <= layer); - MODE === MODES.CAM ? (index >= layer) : (index <= layer); + if (range) { + return index <= layer && index > layer-range; + } else if (MODE === MODES.CAM) { + return index >= layer; + } else { + return index <= layer; + } } /** diff --git a/js/moto-ui.js b/js/moto-ui.js index 2e4451ef..1ee380d4 100644 --- a/js/moto-ui.js +++ b/js/moto-ui.js @@ -183,7 +183,6 @@ var gs_moto_ui = exports; pop.setAttribute("class", "poptext flow-col"); box.setAttribute("style", "position: relative"); - btn.appendChild(box); box.appendChild(pop); pop.appendChild(lbl); pop.appendChild(txt); @@ -195,6 +194,19 @@ var gs_moto_ui = exports; btn.appendChild(DOC.createTextNode("edit")); btn.onclick = function(ev) { + btn.parentNode.appendChild(box); + btn.parentNode.onclick = function(ev) { + ev.stopPropagation(); + if (ev.target === txt) return; + var showing = pop === lastPop; + hidePop(); + if (!showing) { + pop.style.display = "flex"; + lastPop = pop; + txt.focus(); + } + }; + ev.stopPropagation(); if (ev.target === txt) return; var showing = pop === lastPop; @@ -202,6 +214,7 @@ var gs_moto_ui = exports; if (!showing) { pop.style.display = "flex"; lastPop = pop; + txt.focus(); } }; addModeControls(btn, opt); diff --git a/js/web-server.js b/js/web-server.js index 811dcf93..34e11c55 100644 --- a/js/web-server.js +++ b/js/web-server.js @@ -848,10 +848,12 @@ const api = { }, "filters-fdm": (req, res, next) => { + res.setHeader("Content-Type", "application/javascript"); res.end(obj2string(filters_fdm)); }, "filters-cam": (req, res, next) => { + res.setHeader("Content-Type", "application/javascript"); res.end(obj2string(filters_cam)); } diff --git a/web/kiri/style.css b/web/kiri/style.css index 8f9a0c15..3184771f 100644 --- a/web/kiri/style.css +++ b/web/kiri/style.css @@ -567,7 +567,7 @@ button[import="1"] { #layers { display: none; position: fixed; - bottom: 30px; + bottom: 25px; background-color: rgba(0,0,0,0.2); border: 1px solid rgba(0,0,0,0.5); border-radius: 3px; @@ -583,10 +583,11 @@ button[import="1"] { .poptext { display: none; position: absolute; - margin-left: 55px; + margin-left: 30px; border: 5px solid gray; border-radius: 3px; transform: translate(0, -25%); + z-Index: 10000; } .poptext textarea { opacity: 0.95;