From 344da15038afb813f1ea1decb4b3f842548c3ed9 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Mon, 4 Jan 2021 14:24:57 -0600 Subject: [PATCH] Do not need locations/router-scroll https://github.com/DockYard/ember-router-scroll/issues/193 --- addon/locations/router-scroll.js | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 addon/locations/router-scroll.js diff --git a/addon/locations/router-scroll.js b/addon/locations/router-scroll.js deleted file mode 100644 index 64f2c707..00000000 --- a/addon/locations/router-scroll.js +++ /dev/null @@ -1,22 +0,0 @@ -import HistoryLocation from '@ember/routing/history-location'; -import { set, get } from '@ember/object'; - -const uuid = () => 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { - const r = Math.random() * 16 | 0; - const v = c === 'x' ? r : r & 3 | 8; - return v.toString(16); -}); - -export default class extends HistoryLocation { - pushState(path) { - const state = { path, uuid: uuid() }; - get(this, 'history').pushState(state, null, path); - set(this, '_previousURL', this.getURL()); - } - - replaceState(path) { - const state = { path, uuid: uuid() }; - get(this, 'history').replaceState(state, null, path); - set(this, '_previousURL', this.getURL()); - } -}