Created
October 14, 2011 17:33
-
-
Save jrunning/1287755 to your computer and use it in GitHub Desktop.
CoffeeScripty code
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
$('#fixHead td.change').click (evt)-> # jQuery will automatically add the event handler to | |
# every matching element, no need for $.each. | |
evt.preventDefault() # instead of returning false in an event handler | |
# (this is a general JS tip, not just CS) | |
$this = $ this # since you use $(this) twice, just keep it around | |
$('#contactArea').load $this.data 'content' # parentheses are optional... | |
$("#ui-dialog-title-dialog").text($this.attr 'title') # but still useful for clarity | |
centerPopup() | |
loadPopup() | |
$('#popupContact').show() | |
# P.S. Even if we were returning a value here the return keyword is optional-- | |
# the value of the last expression is always returned in CoffeeScript. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment