mirror of
https://github.com/jashkenas/backbone.git
synced 2026-01-25 06:48:07 -05:00
Merge branch 'master' of github.com:documentcloud/backbone
This commit is contained in:
@@ -514,7 +514,7 @@
|
||||
return $(selector, this.el);
|
||||
};
|
||||
|
||||
// Set up all interitable **Backbone.View** properties and methods.
|
||||
// Set up all inheritable **Backbone.View** properties and methods.
|
||||
_.extend(Backbone.View.prototype, {
|
||||
|
||||
// The default tagName of a View's element is "div".
|
||||
|
||||
18
test/view.js
18
test/view.js
@@ -0,0 +1,18 @@
|
||||
$(document).ready(function() {
|
||||
module("Backbone View");
|
||||
|
||||
var View = Backbone.View.extend({
|
||||
className : "view",
|
||||
render : function(){
|
||||
$('body').append(this.el);
|
||||
}
|
||||
});
|
||||
|
||||
var view = new View();
|
||||
view.render();
|
||||
|
||||
test("view: setMode", function(){
|
||||
view.setMode("active", "test");
|
||||
ok(view.el.hasClass("active_test"), "View should set modes");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user