Skip to content

Commit

Permalink
Mounted fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rsnyder committed Sep 26, 2021
1 parent bf460ea commit 5e7c46f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ <h1>Update Juncture site</h1>
console.log(window.location)
const ENV = window.location.hostname === 'localhost' || window.location.hostname.indexOf('gitpod') > 0 ? 'DEV' : 'PROD'
let isJuncture = window.location.hostname.indexOf('juncture-digital.org') === 0 || ENV === 'DEV'
const junctureVersion = 'v0.4.26'
const junctureVersion = 'v0.4.27'
let junctureVersionHash

const referrerUrl = document.referrer
Expand Down Expand Up @@ -548,19 +548,22 @@ <h1>Update Juncture site</h1>
loginsEnabled() { return this.oauthCredsFound && (!this.essayConfig || !this.essayConfig['logins-disabled']) }
},
mounted() {
let path
if (window.location.href.indexOf('#') > 0) {
path = window.location.href.split('#')[0].split('/').slice(3).join('')
anchor = window.location.href.split('#').pop()
let anchor = window.location.href.split('#').pop()
console.log(`path=${path} anchor=${anchor}`)
if (path) this.anchor = anchor
else path = anchor
console.log(`path=${path} anchor=${anchor}`)
}
// this.anchor = window.location.href.indexOf('#') >= 0 ? window.location.href.split('#').pop() : null
window.onpopstate = (e) => this.loadEssay(e.state.file, true)
const resizeObserver = new ResizeObserver(entries => {
this.forceHorizontalLayout = window.matchMedia('only screen and (max-width: 1000px)').matches
})
resizeObserver.observe(this.$refs.app)
this.loadEssay()
this.loadEssay(path)
// Initialize Markdown source viewer
this.markdownViewer = tippy(this.$refs.header, {
trigger: 'manual',
Expand Down

0 comments on commit 5e7c46f

Please sign in to comment.