Created
February 25, 2013 23:16
-
-
Save ralphsmith80/5034245 to your computer and use it in GitHub Desktop.
View extend for templates
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
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