Clean code warnings

* 'readPath' was used before it was defined.
* Missing semicolon
This commit is contained in:
Guy Korland 2020-05-24 11:46:09 +03:00 committed by Changseok Han
parent 49179464f6
commit 9d78b6910c

View File

@ -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);
initData('data/example.json').then(initEvent).then(readPathParam);