From 0d8c91386a79bd9fe63d0ed6e85b1a0ad90001ec Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 14 Sep 2022 09:57:32 +0300 Subject: [PATCH] fixed loading spinner... Signed-off-by: Alex A. Naanou --- pwiki2.html | 6 ++++-- pwiki2.js | 5 ----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pwiki2.html b/pwiki2.html index ba60d99..653ed8c 100755 --- a/pwiki2.html +++ b/pwiki2.html @@ -166,6 +166,7 @@ require.config({ document.pwikiloaded = new Event('pwikiloaded') +REFRESH_DELAY = 20 // start loading pWiki... require(['./browser'], function(browser){ @@ -186,8 +187,9 @@ require(['./browser'], function(browser){ : '/'+path startSpinner() // NOTE: setTimeout(..) to allow the spinner to start... + // NOTE: this seems not to work if the REFRESH_DELAY is too small... setTimeout(function(){ - pwiki.location = [path, hash] }, 0) }) + pwiki.location = [path, hash] }, REFRESH_DELAY) }) pwiki .onBeforeNavigate(function(){ saveNow() }) @@ -226,7 +228,7 @@ require(['./browser'], function(browser){ lnk.addEventListener('click', function(evt){ startSpinner() setTimeout(function(){ - that.refresh() }, 0) }) } }) + that.refresh() }, REFRESH_DELAY) }) } }) // wait for stuff to finish... browser.setup.then(function(){ diff --git a/pwiki2.js b/pwiki2.js index 6c45fa5..0a4fe72 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -9,11 +9,6 @@ * ...bug likely in .text * XXX might also be a good idea to investigate a .tree directory index * as a supplement to .paths() -* XXX BUG: changing the URL does not start the spinner... -* chech: -* - url (hashchange) -* - click link -* - history back/foreward * XXX Q: can we access fs from a pwa??? * XXX start writing docs in pwiki * - WYSIWYG markdown editor/viewer (ASAP)