Skip to content

Commit

Permalink
fix: #9519 unable to properly ajaxify to home on subfolder installs i…
Browse files Browse the repository at this point in the history
…f anchor did not have a trailing slash
  • Loading branch information
julianlam committed Apr 30, 2021
1 parent 46899cc commit db48b95
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/src/ajaxify.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,11 @@ $(document).ready(function () {
var href = $this.attr('href');
var internalLink = utils.isInternalURI(this, window.location, config.relative_path);

const rootAndPath = new RegExp(`^${rootUrl}${config.relative_path}/?`);
var process = function () {
if (!e.ctrlKey && !e.shiftKey && !e.metaKey && e.which === 1) {
if (internalLink) {
var pathname = this.href.replace(rootUrl + config.relative_path + '/', '');
var pathname = this.href.replace(rootAndPath, '');

// Special handling for urls with hashes
if (window.location.pathname === this.pathname && this.hash.length) {
Expand Down

0 comments on commit db48b95

Please sign in to comment.