Skip to content

Instantly share code, notes, and snippets.

@twocathouse
Created December 3, 2014 13:56
Show Gist options
  • Save twocathouse/e1a31ffdcefd6d48d19e to your computer and use it in GitHub Desktop.
Save twocathouse/e1a31ffdcefd6d48d19e to your computer and use it in GitHub Desktop.
$ = jQuery
doc = $(document)
$window = $(window)
class People
constructor: ->
@_setupPhotoGrid()
@_followPersonLink()
_setupPhotoGrid: ->
grid = $('#photo-grid')
photoGrid = new App.PhotoGrid(
el: grid
window: $window
)
photoGrid.render()
_followPersonLink: ->
hash_value = window.location.hash.substring(1)
person = $("[data-person-id='#{hash_value}']")
if person.length > 0
top_bar_height = $("#page-nav").height()
$('body').animate(scrollTop: person.offset().top - top_bar_height)
person.click()
App.People = People
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment