Skip to content

Instantly share code, notes, and snippets.

@ralphsmith80
Created February 25, 2013 23:16
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 ralphsmith80/5034245 to your computer and use it in GitHub Desktop.
Save ralphsmith80/5034245 to your computer and use it in GitHub Desktop.
View extend for templates
View.extend = _.wrap(View.extend, function(func) {
var rest = Array.prototype.slice.call(arguments, 1),
derivedClass = func.apply(this, rest);
derivedClass.prototype.defaults = $.extend(true, {},
derivedClass.__super__.prototype.defaults,
derivedClass.prototype.defaults);
derivedClass.prototype.templates = $.extend(true, {},
derivedClass.__super__.prototype.templates,
derivedClass.prototype.templates);
return derivedClass;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment