Skip to content

Commit

Permalink
* xover.site.pushState - current state won't be copied by default
Browse files Browse the repository at this point in the history
* Node.prototype.transform - fixed non-dashed params
  • Loading branch information
uriel-online committed Jun 11, 2024
1 parent c358945 commit d727982
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2381,7 +2381,7 @@ Object.defineProperty(xover.site, 'seed', {

Object.defineProperty(xover.site, 'pushState', {
value: function (state = {}, href = location.hash) {
history.pushState(Object.merge.call(history.state, { position: history.length - 1 }, state), {}, href);
history.pushState(Object.merge.call({} , { position: history.length - 1 }, state), {}, href);
}
, enumerable: true, writable: false, configurable: false
});
Expand Down Expand Up @@ -7517,7 +7517,7 @@ xover.modernize = async function (targetWindow) {
for (let param of xsl.selectNodes(`//xsl:stylesheet/xsl:param[starts-with(@name,'site:')]`)) {
try {
let param_name = param.getAttribute("name").split(/:/).pop()
let param_value = param_name.indexOf("-") != -1 ? eval(`(xover.site.${param_name.replace(/-/g, '.')})`) : xover.site.state[param_name];
let param_value = param_name.indexOf("-") != -1 ? eval(`(xover.site.${param_name.replace(/-/g, '.')})`) : xover.site[param_name];
if (param_value == undefined && /^\$\{([\S\s]+)\}$/.test(param.value)) {
param_value = eval(`\`${param.value}\``)
}
Expand Down

0 comments on commit d727982

Please sign in to comment.