added migrations for instant delivery
This commit is contained in:
29
node_modules/react-router/lib/behaviors/ImitateBrowserBehavior.js
generated
vendored
Normal file
29
node_modules/react-router/lib/behaviors/ImitateBrowserBehavior.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
var LocationActions = require('../actions/LocationActions');
|
||||
|
||||
/**
|
||||
* A scroll behavior that attempts to imitate the default behavior
|
||||
* of modern browsers.
|
||||
*/
|
||||
var ImitateBrowserBehavior = {
|
||||
|
||||
updateScrollPosition: function updateScrollPosition(position, actionType) {
|
||||
switch (actionType) {
|
||||
case LocationActions.PUSH:
|
||||
case LocationActions.REPLACE:
|
||||
window.scrollTo(0, 0);
|
||||
break;
|
||||
case LocationActions.POP:
|
||||
if (position) {
|
||||
window.scrollTo(position.x, position.y);
|
||||
} else {
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
module.exports = ImitateBrowserBehavior;
|
||||
Reference in New Issue
Block a user