From ae33b2c75ec0e03fd1d80241a4c4b29acadb517c Mon Sep 17 00:00:00 2001 From: "bozo.kopic" Date: Mon, 3 Jan 2022 00:58:17 +0100 Subject: calculate native implementation --- src_js/vt.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src_js/vt.js') diff --git a/src_js/vt.js b/src_js/vt.js index ce16d3d..878280f 100644 --- a/src_js/vt.js +++ b/src_js/vt.js @@ -3,7 +3,6 @@ import * as u from '@hat-open/util'; import * as common from './common'; import * as dragger from './dragger'; -import * as states from './states'; export function main() { @@ -23,7 +22,7 @@ function leftPanelResizer() { mousedown: dragger.mouseDownHandler(evt => { const panel = evt.target.parentNode.querySelector('.left-panel'); const width = panel.clientWidth; - return (_, dx, __) => { + return (_, dx) => { panel.style.width = `${width + dx}px`; }; }) @@ -38,7 +37,7 @@ function rightPanelResizer() { mousedown: dragger.mouseDownHandler(evt => { const panel = evt.target.parentNode.querySelector('.right-panel'); const width = panel.clientWidth; - return (_, dx, __) => { + return (_, dx) => { panel.style.width = `${width - dx}px`; }; }) @@ -72,7 +71,11 @@ function leftPanel() { ['label'], checkboxInput('Minimize initial panel usage', r.get('form', 'min_initial_usage'), - val => r.set(['form', 'min_initial_usage'], val)) + val => r.set(['form', 'min_initial_usage'], val)), + ['label'], + checkboxInput('Use native implementation', + r.get('form', 'native'), + val => r.set(['form', 'native'], val)) ], ['div.content', leftPanelPanels(), @@ -99,7 +102,7 @@ function leftPanelPanels() { const valid = !panelNames.has(name); panelNames.add(name); return valid; - } + }; return ['div', ['table', @@ -198,7 +201,7 @@ function leftPanelItems() { const valid = !itemNames.has(name); itemNames.add(name); return valid; - } + }; return ['div', ['table', -- cgit v1.2.3-70-g09d2