Created
January 24, 2013 14:30
-
-
Save davidlaym/4622303 to your computer and use it in GitHub Desktop.
a jquery ui 1.9 widget boilerplate code using coffeescript
This file contains hidden or 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
do ($ = jQuery, window, document) -> | |
$.widget "namespace.widgetName", | |
options: | |
somevalue: null | |
someCallback: -> | |
_create: -> | |
#element creation, apply theming, bind events etc. | |
_destroy: -> | |
#cleanup DOM | |
_setOption: (key, value) -> | |
switch key | |
when "someValue" | |
# this.options.someValue = doSomethingWith( value ); | |
else | |
# this.options[ key ] = value; | |
this._super( "_setOption", key, value ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment