2015-04-29 11:02:32 +02:00
|
|
|
'use strict';
|
2015-04-21 19:38:17 +02:00
|
|
|
|
2015-04-29 11:02:32 +02:00
|
|
|
var HistoryLocation = require('./HistoryLocation');
|
|
|
|
var History = require('../History');
|
2015-04-21 19:38:17 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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() {
|
2015-04-29 11:02:32 +02:00
|
|
|
return '<RefreshLocation>';
|
2015-04-21 19:38:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = RefreshLocation;
|