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
Prev Previous commit
Next Next commit
make current path a MeteorRider property so we can use it on the onSu…
…ccess property
  • Loading branch information
DanielOchoa committed Jun 25, 2014
commit 356f4e198e3dd5310542d9ca808e2a588440df9f
6 changes: 4 additions & 2 deletions www/js/meteor-rider.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var MeteorRider = {
init: function(currentPath) {

this.meteorUrl = __MeteorRiderConfig__.meteorUrl;
this.currentPath = currentPath;

if (! (this.meteorUrl.length > 0)) {
console.error('MeteorRider: error: unable to determine config.meteorUrl');
Expand Down Expand Up @@ -61,12 +62,12 @@ var MeteorRider = {
console.log(data);

// set 'currentPath' to empty string if not passed
currentPath = (typeof currentPath === 'string' ? currentPath : '');
this.currentPath = (typeof this.currentPath === 'string' ? this.currentPath : '');
// 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({}, "", this.meteorUrl + currentPath);
window.history.replaceState({}, "", this.meteorUrl + this.currentPath);
} else {
// TODO: should we do window.history.add() or something?
}
Expand All @@ -80,6 +81,7 @@ var MeteorRider = {
document.write(data);
document.close();
// trigger the "loaded" events (it'd be nice to do this AFTER JS has loaded
// TODO: change these to use plain javascript instead of zepto
$(document).trigger('DOMContentLoaded');
$(document).trigger('load');
$(document).trigger('complete');
Expand Down