mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-08-09 15:53:38 +00:00
add contentBodyElement to device
This commit is contained in:
+5
-4
@@ -40,15 +40,17 @@ function drawDeviceFrame(id) {
|
||||
</style>
|
||||
<link href='src/assets/css/plugin_default.css' rel='stylesheet' type='text/css'>
|
||||
</head>
|
||||
<body>
|
||||
${generateBodyHTML(d)}
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
|
||||
d.contentBodyElement = document.createElement('body');
|
||||
|
||||
d.contentBodyElement.innerHTML = generateBodyHTML(d);
|
||||
|
||||
$deviceDrawArea.setAttribute('class', `${d.type} draw-area`);
|
||||
$deviceDrawArea.contentWindow.document.open();
|
||||
$deviceDrawArea.contentWindow.document.write(str);
|
||||
$deviceDrawArea.contentWindow.document.body = d.contentBodyElement;
|
||||
$deviceDrawArea.contentWindow.document.close();
|
||||
$deviceDrawArea.contentWindow.document.onclick = function (e) {
|
||||
switchDevice(d.id);
|
||||
@@ -98,7 +100,6 @@ function generateBodyHTML(d) {
|
||||
|
||||
module.exports.draw = function draw(device) {
|
||||
const d = device;
|
||||
const $deviceDrawArea = document.getElementById(`device-${d.id}-draw-area`);
|
||||
|
||||
if (device.drawTimeout !== undefined) {
|
||||
clearTimeout(device.drawTimeout);
|
||||
|
||||
Reference in New Issue
Block a user