Prettified all files.
This commit is contained in:
+3
-6
@@ -7,7 +7,6 @@
|
||||
* @class Theme
|
||||
*/
|
||||
export default class Theme {
|
||||
|
||||
/**
|
||||
* Loads a config file and parses it to JSON.
|
||||
*
|
||||
@@ -18,17 +17,15 @@ export default class Theme {
|
||||
*/
|
||||
static loadConfig(path = null) {
|
||||
return new Promise((resolve, reject) => {
|
||||
path = (path) ? path : './config.json'
|
||||
path = path ? path : './config.json'
|
||||
|
||||
let xhttp = new XMLHttpRequest()
|
||||
xhttp.onreadystatechange = function () {
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4) {
|
||||
|
||||
if (this.status == 200 || Theme._isLocal()) {
|
||||
try {
|
||||
const json = JSON.parse(this.responseText)
|
||||
resolve(json)
|
||||
|
||||
} catch (e) {
|
||||
reject(e)
|
||||
}
|
||||
@@ -41,6 +38,6 @@ export default class Theme {
|
||||
}
|
||||
|
||||
static _isLocal() {
|
||||
return (window.location.protocol == 'file:')
|
||||
return window.location.protocol == 'file:'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user