add pinned log spinner

This commit is contained in:
Stewart Allen 2022-03-31 20:45:49 -04:00
commit 262a86cd2e
5 changed files with 32 additions and 5 deletions

View file

@ -317,7 +317,7 @@ function space_init(data) {
if (shiftKey) return api.tool.regroup();
return api.grid();
case 'KeyL':
return api.log.toggle();
return api.log.toggle({ spinner: false });
case 'KeyS':
if (shiftKey) return selection.visible({toggle:true});
return call.edit_split();

View file

@ -145,17 +145,21 @@ const log = api.log = {
return log;
},
toggle() {
return log.pinned ? log.unpin() && log.hide() : log.pin();
toggle(opt) {
return log.pinned ? log.unpin() && log.hide() : log.pin(opt);
},
pin() {
pin(opt = { spinner: true }) {
log.pinned = true;
if (opt.spinner) {
$('pinner').style.display = 'inline-block';
}
return log.show();
},
unpin() {
log.pinned = false;
$('pinner').style.display = 'none';
return log.show();
},

View file

@ -592,7 +592,7 @@ mesh.model = class MeshModel extends mesh.object {
let { a, b, c } = face;
let timer = setTimeout(() => {
timer = undefined;
mesh.api.log.emit("matching surface...");
mesh.api.log.emit("matching surface").pin();
}, 500);
worker.model_select({
id: this.id, x, y:-z, z:y, a, b, c, matrix: this.matrix, radians
@ -605,6 +605,10 @@ mesh.model = class MeshModel extends mesh.object {
// this.toggleSelectedVertices(verts);
this.selectFaces(faces, action);
this.updateSelections();
if (!timer) {
mesh.api.log.emit("surface match complete").unpin();
moto.space.refresh();
}
});
}