Skip to content

Instantly share code, notes, and snippets.

@osiro
Created November 29, 2012 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osiro/4167314 to your computer and use it in GitHub Desktop.
Save osiro/4167314 to your computer and use it in GitHub Desktop.
venues_index_controller.js.coffee
class GotApp.VenueIndexController extends tfg.BackPanel
title: I18n.t 'title'
className: 'screen-venues'
day: (new Date).strftime('%A').toLowerCase()
elements:
'.venues-index-venue' : 'listOfVenues'
'.sort-venues-menu' : 'sortMenu'
'.sort-by' : 'sortOptions'
'.venues-list' : 'venuesList'
'.search-results-ad' : 'ad'
'#venues-index-canvas': 'mapEl'
events:
'tap .sort-by' : 'sortVenues'
'tap .venues-index-venue' : 'toVenueDetails'
'tap #venues-index-canvas': 'toMapExplorer'
toggleSortMenu: ->
@sortMenu.add(@sortButton).toggleClass 'active'
if @PLATFROM is 'android'
@scroller.scrollTo 0,0
else
@el.find('.scroll-wrapper').scrollTop 0
setTimeout =>
@scroller?.refresh()
, 250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment