diff --git a/CHANGELOG.md b/CHANGELOG.md index e89dfaee..628917e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - `event.preventDefault` in `onTouch` now affect modal buttons - menu: use click event instead of tap in `toggle` and `doubleTap-toggle` modes - button: missing `move` events in `onTouch` + - error when logging `event` object in `onTouch` - widgets - modal/button/file: add `click` property diff --git a/src/client/widgets/vm.mjs b/src/client/widgets/vm.mjs index 24124ecd..389dceaa 100644 --- a/src/client/widgets/vm.mjs +++ b/src/client/widgets/vm.mjs @@ -56,7 +56,7 @@ class Vm { this.globals.console = { ...console, log: (...msg)=>{ - msg = msg.map(m => typeof m == 'object' ? JSON.stringify(m) : m) + msg = msg.map(m => typeof m == 'object' ? JSON.stringify(m, this.jsonReplacer) : m) this.getWidget().log(msg.join(' ')) } } @@ -143,6 +143,10 @@ class Vm { } + jsonReplacer(key, value) { + return value instanceof HTMLElement ? `<${value.tagName}#${value.id}>` : value + } + } export default Vm