Skip to content

Instantly share code, notes, and snippets.

@markevans
Forked from sjltaylor/view_example.js
Created June 8, 2012 16:28
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 markevans/2896644 to your computer and use it in GitHub Desktop.
Save markevans/2896644 to your computer and use it in GitHub Desktop.
Example use of a view, using the class stuff
define(['view'], function(View){
return View.sub('ItemView', function(){
this.domEvent('click', 'button', 'selected')
})
})
///////////////////////////////////////////////////////
define(['type', 'view'], function(Type, View){
return Type('ItemView') // name is optional
.use(View) // this defines a static 'domEvent' function which I use below
.domEvent('click', 'button', 'selected')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment