From e835e0d2697daf883af99251cf581bf2bdf855ca Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 7 Nov 2018 11:46:08 +0200 Subject: [PATCH] cleanup --- client/src/router.js | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/client/src/router.js b/client/src/router.js index 5c89cccafa..d98ac45e4d 100644 --- a/client/src/router.js +++ b/client/src/router.js @@ -254,44 +254,30 @@ if (isIOS9UIWebView()) { }); }; - Backbone.history.navigate = - // Attempt to load the current URL fragment. If a route succeeds with a - // match, returns `true`. If no defined routes matches the fragment, - // returns `false`. - function (fragment, options) { + Backbone.history.navigate = function (fragment, options) { var pathStripper = /#.*$/; if (!Backbone.History.started) return false; if (!options || options === true) options = { trigger: !!options }; var url = this.root + '#' + (fragment = this.getFragment(fragment || '')); - // Strip the hash for matching. fragment = fragment.replace(pathStripper, ''); if (this.fragment === fragment) return; this.fragment = fragment; - // Don't include a trailing slash on the root. if (fragment === '' && url !== '/') url = url.slice(0, -1); var oldHash = location.hash; - // If pushState is available, we use it to set the fragment as a real URL. + if (this._hasPushState) { this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url); - // If hash changes haven't been explicitly disabled, update the hash - // fragment to store history. } else if (this._wantsHashChange) { this._updateHash(this.location, fragment, options.replace); if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) { - // Opening and closing the iframe tricks IE7 and earlier to push a - // history entry on hash-tag change. When replace is true, we don't - // want this. if (!options.replace) this.iframe.document.open().close(); this._updateHash(this.iframe.location, fragment, options.replace); } - - // If you've told us that you explicitly don't want fallback hashchange- - // based history, then `navigate` becomes a page refresh. } else { return this.location.assign(url); }