Skip to content

Commit

Permalink
Bugfix when theme is used on https url
Browse files Browse the repository at this point in the history
Without this fix, when you load this theme on https url and click on 'Browse Posts', the site will hang
  • Loading branch information
pdeva committed Jul 7, 2015
1 parent ad7dd31 commit 5019c41
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions assets/js/scripts.js
Expand Up @@ -94,6 +94,14 @@ jQuery(function($) {
var url = $(this).attr('href');
var title = $(this).attr('title') || null;

//if url starts with http:// and currentState.url starts with
// https://, replace the protocol in url
if(url.startsWith("http://"))
{
var urlNoProt = url.replace(/.*?:\/\//g, "");
var curProt = currentState.url.split("/")[0];
url = curProt + "//" + urlNoProt;
}
// If the requested url is not the current states url push
// the new state and make the ajax call.
if (url !== currentState.url.replace(/\/$/, "")) {
Expand Down

0 comments on commit 5019c41

Please sign in to comment.