mirror of
https://github.com/twisterarmy/twister-react.git
synced 2025-01-27 07:04:20 +00:00
31 lines
615 B
JavaScript
31 lines
615 B
JavaScript
|
"use strict";
|
||
|
|
||
|
var HistoryLocation = require("./HistoryLocation");
|
||
|
var History = require("../History");
|
||
|
|
||
|
/**
|
||
|
* A Location that uses full page refreshes. This is used as
|
||
|
* the fallback for HistoryLocation in browsers that do not
|
||
|
* support the HTML5 history API.
|
||
|
*/
|
||
|
var RefreshLocation = {
|
||
|
|
||
|
push: function push(path) {
|
||
|
window.location = path;
|
||
|
},
|
||
|
|
||
|
replace: function replace(path) {
|
||
|
window.location.replace(path);
|
||
|
},
|
||
|
|
||
|
pop: History.back,
|
||
|
|
||
|
getCurrentPath: HistoryLocation.getCurrentPath,
|
||
|
|
||
|
toString: function toString() {
|
||
|
return "<RefreshLocation>";
|
||
|
}
|
||
|
|
||
|
};
|
||
|
|
||
|
module.exports = RefreshLocation;
|