mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-24 11:50:58 -04:00
parent
9a5c4b6ced
commit
f0a873cf02
1 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue