From 9d78b6910cd06196e8aa797247755ffaf697ccb8 Mon Sep 17 00:00:00 2001 From: Guy Korland Date: Sun, 24 May 2020 11:46:09 +0300 Subject: [PATCH] Clean code warnings * 'readPath' was used before it was defined. * Missing semicolon --- wasm/www/index.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/wasm/www/index.js b/wasm/www/index.js index 3ee66c2..e071b83 100644 --- a/wasm/www/index.js +++ b/wasm/www/index.js @@ -53,9 +53,16 @@ function initEvent() { } } +function readPath() { + let query = location.href.substring(location.href.indexOf('#') + 1); + let path = decodeURIComponent(query); + getJsonpathInput().value = path; + forceClick(getReadBtn()); +} + function readPathParam() { if(location.href.indexOf('#') > -1) { - readPath() + readPath(); } } @@ -67,13 +74,6 @@ function forceClick(ctrl) { ctrl.dispatchEvent(event, true); } -function readPath() { - let query = location.href.substring(location.href.indexOf('#') + 1); - let path = decodeURIComponent(query); - getJsonpathInput().value = path; - forceClick(getReadBtn()); -} - window.onpopstate = readPath; -initData('data/example.json').then(initEvent).then(readPathParam); \ No newline at end of file +initData('data/example.json').then(initEvent).then(readPathParam);