I can’t wait until Chrome has majority market share
This commit is contained in:
Michael Schmatz 2014-05-08 11:17:15 -07:00
parent 9a5c4b6ced
commit f0a873cf02

View file

@ -50,7 +50,9 @@ module.exports = class EmployersView extends View
renderCandidatesAndSetupScrolling: =>
@render()
$(".nano").nanoScroller()
if window.location.hash.length is 25
if window.history?.state?.lastViewedCandidateID
$(".nano").nanoScroller({scrollTo:$("#" + window.history.state.lastViewedCandidateID)})
else if window.location.hash.length is 25
$(".nano").nanoScroller({scrollTo:$(window.location.hash)})
sortTable: ->
@ -175,8 +177,13 @@ module.exports = class EmployersView extends View
onCandidateClicked: (e) ->
id = $(e.target).closest('tr').data('candidate-id')
window.location.hash = id
if id
if window.history
oldState = _.cloneDeep window.history.state ? {}
oldState["lastViewedCandidateID"] = id
window.history.replaceState(oldState,"")
else
window.location.hash = id
url = "/account/profile/#{id}"
app.router.navigate url, {trigger: true}
else