now links to the same page will .refres() + notes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-08-26 18:41:05 +03:00
parent eec1e725d3
commit 365b6ad319
2 changed files with 13 additions and 3 deletions

View File

@ -131,13 +131,20 @@ require(['./browser'], function(browser){
// separates the navigate and load events...
this.refresh() })
.onLoad(function(evt){
var that = this
// handle title...
document.querySelector('title').innerHTML = this.title
// scroll to anchor element...
this.hash
&& this.dom
.querySelector('#'+ this.hash)
.scrollIntoView() })
.scrollIntoView()
// handle refresh...
// NOTE: we need to do this as hashchange is only triggered
// when the hash is actually changed...
for(var lnk of this.dom.querySelectorAll(`a[href="${window.location.hash}"]`)){
lnk.addEventListener('click', function(evt){
that.refresh() }) } })
// wait for stuff to finish...
browser.setup.then(function(){

View File

@ -3,12 +3,15 @@
*
* XXX BUG: for some reason pwiki.get('/TestPage').raw does nothing when
* the root store is not BaseStore...
* ...seems to be a problem explicitly with /TestPage, could this
* be a name clash with /Test???
* ...the cause is:
* pwiki.store.substore('/TestPage') -> 'Test'
* should be:
* pwiki.store.substore('/TestPage') -> undefined
* XXX BUG service pages (*Error) now print "[ native code ]" instead of
* the path and replacing @quote(..) with @source(..) breaks things...
* ...this seems to happen only if the root store is not
* MetaStore/BaseStore...
* XXX BUG: .get(..) does not seem to resolve to <store>.next...
* XXX page search: make things invariant via .names
* - if a page is in a system path and there are no alternatives
* just return it and do not search.