Use setElement to set the view's element properly.

This commit is contained in:
Jonathan Frederic 2013-11-20 22:16:53 +00:00
parent 0cd4226fde
commit 00f72487c5

View File

@ -24,13 +24,12 @@ define(["notebook/js/widget"], function(widget_manager){
// Called when view is rendered. // Called when view is rendered.
render : function(){ render : function(){
var that = this; var that = this;
this.$el = $("<button />") this.setElement($("<button />")
.addClass('btn') .addClass('btn')
.click(function() { .click(function() {
that.model.set('clicks', that.model.get('clicks') + 1); that.model.set('clicks', that.model.get('clicks') + 1);
that.model.update_other_views(that); that.model.update_other_views(that);
}); }));
this._ensureElement();
this.update(); // Set defaults. this.update(); // Set defaults.
}, },