fix text area editing
This commit is contained in:
parent
49d47a89fe
commit
b99f165a92
2 changed files with 28 additions and 13 deletions
12
js/kiri.js
12
js/kiri.js
|
|
@ -1329,6 +1329,8 @@ self.kiri.copyright = exports.COPYRIGHT;
|
|||
nval = parseInt(nval);
|
||||
}
|
||||
}
|
||||
} else if (uie.type === 'textarea') {
|
||||
nval = uie.value.trim().split('\n');
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1366,6 +1368,16 @@ self.kiri.copyright = exports.COPYRIGHT;
|
|||
device.internal++;
|
||||
updateExtruderFields(device);
|
||||
};
|
||||
UI.extDel.disabled = device.extruders.length < 2;
|
||||
UI.extDel.onclick = function() {
|
||||
device.extruders.splice(device.internal,1);
|
||||
updateExtruderFields(device);
|
||||
};
|
||||
UI.extAdd.onclick = function() {
|
||||
device.extruders.push(clone(device.extruders[device.internal]));
|
||||
device.internal = device.extruders.length - 1;
|
||||
updateExtruderFields(device);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -328,9 +328,14 @@ var gs_moto_ui = exports;
|
|||
|
||||
btn.appendChild(DOC.createTextNode("edit"));
|
||||
btn.onclick = function(ev) {
|
||||
ev.stopPropagation();
|
||||
if (ev.target === txt) {
|
||||
// drop clicks on TextArea
|
||||
ev.target.focus();
|
||||
} else {
|
||||
// first time, button click / show
|
||||
btn.parentNode.appendChild(box);
|
||||
btn.parentNode.onclick = btn.onclick;
|
||||
ev.stopPropagation();
|
||||
txt.scrollTop = 0;
|
||||
txt.scrollLeft = 0;
|
||||
txt.selectionEnd = 0;
|
||||
|
|
@ -341,12 +346,10 @@ var gs_moto_ui = exports;
|
|||
});
|
||||
txt.setAttribute("cols", Math.max(30, cols + 1));
|
||||
txt.setAttribute("rows", Math.max(10, rows.length + 1));
|
||||
// drop clicks on TextArea
|
||||
if (ev.target === txt) {
|
||||
ev.target.focus();
|
||||
} else {
|
||||
|
||||
let showing = pop === lastPop;
|
||||
hidePop();
|
||||
inputAction();
|
||||
if (!showing) {
|
||||
pop.style.display = "flex";
|
||||
lastPop = pop;
|
||||
|
|
|
|||
Loading…
Reference in a new issue