Skip to content

Commit

Permalink
Move to hash routing (windows bug #59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rik Smith-Unna committed May 4, 2017
1 parent 23e885b commit be5fd8a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 44 deletions.
8 changes: 4 additions & 4 deletions app/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ app.use(require('./models/search'))
app.use(require('./models/selection'))
app.use(require('./models/tags'))

app.route('/', require('./views/start'))
app.route('/home', require('./views/home'))
app.route('/initial', require('./views/initial'))
app.route('/reader', require('./views/reader'))
app.route('#', require('./views/start'))
app.route('#home', require('./views/home'))
app.route('#initial', require('./views/initial'))
app.route('#reader', require('./views/reader'))

app.mount('body')
4 changes: 2 additions & 2 deletions app/client/models/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ module.exports = (state, bus) => {

bus.on('initialising:start', () => {
state.initialising = true
bus.emit('pushState', '/initial')
bus.emit('pushState', '#initial')
})

bus.on('initialising:stop', () => {
state.initialising = false
bus.emit('pushState', '/home')
bus.emit('pushState', '#home')
})
}
4 changes: 2 additions & 2 deletions app/client/models/reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module.exports = (state, bus) => {

bus.on('reader:read', paper => {
state.reading = paper
bus.emit('pushState', `/reader`)
bus.emit('pushState', '#reader')
})

bus.on('reader:quit', () => {
state.reading = null
bus.emit('pushState', '/home')
bus.emit('pushState', '#home')
})
}
36 changes: 0 additions & 36 deletions app/client/state.js

This file was deleted.

0 comments on commit be5fd8a

Please sign in to comment.