* [task#127426] render region input for canvas.

This commit is contained in:
wangzemei
2024-09-06 15:00:24 +08:00
committed by 刘刚
parent 0c2333da0d
commit 02aeddd936
2 changed files with 12 additions and 2 deletions
+10
View File
@@ -250,6 +250,16 @@ function drawRegionInput(canvas, region, colorIndex, area)
color: '#000',
backgroundColor: colors[colorIndex % colors.length],
};
const input = document.createElement('input');
input.type = 'text';
input.value = area;
input.id = `input_${colorIndex}`;
input.name = `area[${area}]`;
input.placeholder = area;
Object.assign(input.style, styles);
canvas.parentNode.appendChild(input);
}
/**
+2 -2
View File
@@ -11,11 +11,11 @@ class think3c extends thinkModel
return file_get_contents(__DIR__ . DS . 'js' . DS . 'v1.js');
}
protected function buildBody(): array
protected function buildBody(): node
{
jsVar('modelImg', 'data/thinmory/thumbnail/init3c.png');
return array(h::canvas(setID('canvas')));
return div(setCLass('relative'), h::canvas(setID('canvas')));
}
protected function build(): node