diff --git a/src/components/JSONEditor.svelte b/src/components/JSONEditor.svelte index 563ab2c..3513b2b 100644 --- a/src/components/JSONEditor.svelte +++ b/src/components/JSONEditor.svelte @@ -2,17 +2,16 @@ import Modal from 'svelte-simple-modal' import TreeMode from './treemode/TreeMode.svelte' - export let config = {} - let mode - let restConfig + const DefaultMode = TreeMode - $: { - let { _mode, ..._restConfig } = config - mode = _mode - restConfig = _restConfig + export let config = {} + + function getRestConfig (config) { + let { mode, ...restConfig } = config + return restConfig } - + diff --git a/src/utils/domUtils.js b/src/utils/domUtils.js index d679fdf..6473ee4 100644 --- a/src/utils/domUtils.js +++ b/src/utils/domUtils.js @@ -205,6 +205,7 @@ function hasAttribute(element, name, value) { * @returns {*} */ export function isChildOf (element, predicate) { + // TODO: can we replace isChildOf with Element.closest? let e = element while (e && !predicate(e)) {