diff --git a/src/view.js b/src/view.js index 9707a2c..c828782 100644 --- a/src/view.js +++ b/src/view.js @@ -20,6 +20,10 @@ function drawDeviceFrame(id) { return true; } + $deviceDrawArea.onclick = function (e) { + console.log('oo'); + }; + const d = DEVICE.all[id]; let str = '
'; @@ -47,6 +51,9 @@ function drawDeviceFrame(id) { $deviceDrawArea.contentWindow.document.open(); $deviceDrawArea.contentWindow.document.write(str); $deviceDrawArea.contentWindow.document.close(); + $deviceDrawArea.contentWindow.document.onclick = function (e) { + switchDevice(d.id); + }; if (d.pinIndex) { $devicePinned.style.display = 'block'; @@ -161,13 +168,13 @@ function switchDevice(id) { // document.getElementById('refresh-device-button').style.opacity = 1; const i = DEVICE.all[id].id; - let $deviceWrapper = document.getElementById(`device-${i}`); + const $deviceWrapper = document.getElementById(`device-${i}`); if (!$deviceWrapper) { const html = `