From 30e1c448d39a6c294f0911d26d5d5d59d5c388d9 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 17 Nov 2020 19:35:09 +0530 Subject: [PATCH] cleanup and lint compliance --- customize.dist/loading.js | 15 ++++++++++----- www/common/boot2.js | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/customize.dist/loading.js b/customize.dist/loading.js index 1db126fa5..e3f5c24f7 100644 --- a/customize.dist/loading.js +++ b/customize.dist/loading.js @@ -315,10 +315,17 @@ button.primary:hover{ var hideSpinner = function () { try { document.querySelector('.cp-loading-spinner-container').style.display = 'none'; - document.querySelector('.cp-loading-spinner-container').setAttribute('style', 'display:none;'); } catch (err) { return; } }; + var getList = function () { + return document.querySelector('.cp-loading-progress-list') || {}; + }; + + var getProgressBar = function () { + return document.querySelector('.cp-loading-progress-container') || {}; + }; + var hasErrored = false; var updateLoadingProgress = function (data) { if (!built || !data) { return; } @@ -326,10 +333,8 @@ button.primary:hover{ if (c < current) { return console.error(data); } try { hideSpinner(); - var list = document.querySelector('.cp-loading-progress-list'); - list && (list.innerHTML = makeList(data)); - var container = document.querySelector('.cp-loading-progress-container'); - container && (container.innerHTML = makeBar(data)); + getList().innerHTML = makeList(data); + getProgressBar().innerHTML = makeBar(data); } catch (e) { if (!hasErrored) { console.error(e); } } diff --git a/www/common/boot2.js b/www/common/boot2.js index 87bba4a43..0d879b32f 100644 --- a/www/common/boot2.js +++ b/www/common/boot2.js @@ -61,7 +61,7 @@ define([ if (window.Proxy) { var c = console; - window.console = new Proxy(c, { + window.console = new window.Proxy(c, { get: function (o, k) { if (k !== 'error') { return o[k]; } return function () {