Created
February 22, 2014 00:27
-
-
Save srsgores/9146596 to your computer and use it in GitHub Desktop.
map toolbar coffeescript sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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