Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
use variable already set for URL
  • Loading branch information
DanielOchoa committed Jun 25, 2014
commit 048e5df55eef45d7dfce730154f98496b100c9e4
10 changes: 5 additions & 5 deletions www/js/meteor-rider.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var MeteorRider = {
}
// trigger request
$.ajax({
url: __MeteorRiderConfig__.meteorUrl,
url: meteorUrl,
cache: false,
// TODO: split to method on MeteorRider
error: function( jqXHR, textStatus, errorThrown ) {
Expand All @@ -54,20 +54,20 @@ var MeteorRider = {
data = data.replace(/(href|src|manifest)\=\"\//gm, '$1="' + meteorUrl + '/');
console.log(meteorUrl);
console.log(data);

// set 'currentPath' to empty string if not passed
currentPath = (typeof currentPath === 'string' ? currentPath : '');
// set the window.location object correctly so iron-router
// set the window.location object correctly so iron-router
// and other packages that depend on window.location work correctly
if (typeof window.history.replaceState === 'function') {
// window.history.replaceState() not supported in all clients
window.history.replaceState({}, "", meteorUrl + currentPath);
} else {
// TODO: should we do window.history.add() or something?
}

// replace the document with the new document/data
// this is the REAL hijacking...
// this is the REAL hijacking...
// all old JS remains (unless overwritten, name collision)
// all HTML is replaced/overwritten
// all new CSS/JS is loaded
Expand Down