feat: allow hashtab #override labels in note text

This commit is contained in:
Stewart Allen 2024-05-18 10:31:25 -04:00
commit 4caa57bf6d

View file

@ -454,6 +454,7 @@ CAM.init = function(kiri, api) {
currentIndex = isIndexed && !isPreview ? index * DEG2RAD : 0;
}
// (re)render thea re-orderable op list
api.event.on("cam.op.render", func.opRender = () => {
let oplist = current.process.ops;
if (!(isCamMode && oplist)) {
@ -470,6 +471,8 @@ CAM.init = function(kiri, api) {
let clock = rec.type === '|';
let label = clock ? `<i class="fa-regular fa-clock"></i>` : rec.type;
let clazz = notime ? [ "draggable", "notime" ] : [ "draggable" ];
let notable = rec.note?.split(' ').filter(v => v.charAt(0) === '#');
if (notable?.length) label = notable[0].slice(1);
html.appendAll([
`<div id="${mark+i}" class="${clazz.join(' ')}">`,
`<label class="label">${label}</label>`,
@ -1677,6 +1680,7 @@ function createPopOp(type, map) {
$(noteid).innerText = poppedRec.note = note;
API.conf.save();
}
func.opRender();
};
const note = $(noteid);
if (note) note.innerText = poppedRec.note || '';