Skip to content

Instantly share code, notes, and snippets.

@srsgores
Created February 22, 2014 00:27
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 srsgores/9146596 to your computer and use it in GitHub Desktop.
Save srsgores/9146596 to your computer and use it in GitHub Desktop.
map toolbar coffeescript sample
class MapToolbar
constructor: (@toggled, @mapToolbar, @toolbarToggle, @mapToolbarIcon, @mapToolbarContent, @searchButton) ->
# Variables
@mapToolbar = $(".mapToolbar")
@toolbarToggle = @mapToolbar.find(".show-toolbar")
@mapToolbarIcon = @toolbarToggle.find("i")
@mapToolbarContent = @mapToolbar.find(".toolbar-content")
@searchButton = @mapToolbar.find(".show-search")
search: ->
@searchButton.on "click", ->
# TODO: Search click functionality
initMapToggle: ->
if @toggled is on then return
hideMapContent mapToolbarContent
toolbarToggle.on "click", ->
mapToolbarContent.toggle "slow"
# toggle icon
mapToolbarIcon.toggleClass "icon-expand icon-contract"
toggleMapToolbar: ->
@mapToolbarContent.hide("slow")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment