Reduce condition complexity
This commit is contained in:
parent
e206dd527e
commit
a3c45f6ed6
6 changed files with 31 additions and 64 deletions
|
@ -142,11 +142,8 @@ OSM.Router = function (map, rts) {
|
|||
};
|
||||
|
||||
router.stateChange = function (state) {
|
||||
if (state.center) {
|
||||
window.history.replaceState(state, document.title, OSM.formatHash(state));
|
||||
} else {
|
||||
window.history.replaceState(state, document.title, window.location);
|
||||
}
|
||||
const url = state.center ? OSM.formatHash(state) : window.location;
|
||||
window.history.replaceState(state, document.title, url);
|
||||
};
|
||||
|
||||
router.updateHash = function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue