Skip to content

Commit

Permalink
* xover.stores - bug fixed for # stores
Browse files Browse the repository at this point in the history
* xover.Source.fetch - fixed searchParameters for seed
* xover.Store
  - hash - gets hash from configuration
  - render - restored hash update before document fetch
  • Loading branch information
uriel-online committed Mar 11, 2024
1 parent 0e4313b commit fd50de5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions xo.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ xover.stores = new Proxy({}, {
}
return exists && !(key in self)
}, has: function (self, key) {
return key != '#' && (key in self || key.toLowerCase() in self || key in xover.sources) || key in (xover.manifest.server || {});
return (key in self || key.toLowerCase() in self || key in xover.sources) || key in (xover.manifest.server || {});
}
});

Expand Down Expand Up @@ -2725,9 +2725,9 @@ xover.Source = function (tag) {
}
let url = new xover.URL(tag_string.replace(/^#/, ''));
parameters = parameters.concat([...url.searchParams.entries()]);
let current_url = xover.URL(location.hash.replace(/^#/, ''));
if (location.hash && current_url.pathname === xover.URL(url).pathname) {
parameters = parameters.concat([...current_url.searchParams.entries()])
let current_url = xover.URL(xover.site.seed.replace(/^#/, ''));
if (location.searchParams && current_url.pathname === xover.URL(url).pathname) {
parameters = parameters.concat([...location.searchParams.entries()])
}
}

Expand Down Expand Up @@ -10133,7 +10133,7 @@ xover.Store = function (xml, ...args) {

Object.defineProperty(this, 'hash', {
get: function () {
return [_hash, xover.manifest.getSettings(this, 'hash').pop(), config.tag && store.tag || ''].coalesce();
return [_hash, xover.manifest.getSettings(this, 'hash').pop(), config.tag/* && store.tag*/ || ''].coalesce();
/*return '#' + Array.prototype.coalesce(_hash, __document.documentElement && Array.prototype.coalesce(__document.documentElement.getAttributeNS("http://panax.io/xover", "hash"), __document.documentElement.getAttributeNS("http://panax.io/xover", "tag"), __document.documentElement.localName.toLowerCase()), _tag).split(/^#/).pop();*/
},
set: function (input) {
Expand Down Expand Up @@ -10600,12 +10600,12 @@ xover.Store = function (xml, ...args) {
// progress = xover.sources['loading.xslt'].render({ action: "append" });
//}
let active_store = xover.stores.active
if (!__document.firstChild) {
await store.fetch();
}
if (active_store === self) {
xover.site.hash = self.hash;
}
if (!__document.firstChild) {
await store.fetch();
}
let document = __document.cloneNode(true);
window.top.dispatchEvent(new xover.listener.Event('beforeRender', { store: this, tag, document }, this));
let renders = [];
Expand Down

0 comments on commit fd50de5

Please sign in to comment.