* [task#127426] render region input for canvas.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user