Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
More robust url construction
Browse files Browse the repository at this point in the history
  • Loading branch information
Dayton Nolan committed Aug 30, 2016
1 parent 15006a9 commit a3fe95e
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -40,9 +40,17 @@ module.exports = (function () { // eslint-disable-line no-unused-vars
this.loadingText = 'Loading...';

defaults(options, {
baseUrl: window.location.href,
baseUrl: [
window.location.protocol, '//',
window.location.host,
window.location.pathname,
window.location.search,
window.location.hash,
].join(''),
});

options.baseUrl = stripTrailingSlash(options.baseUrl);

assign(this, options);

element.addEventListener('click', function () {
Expand Down

0 comments on commit a3fe95e

Please sign in to comment.