##// END OF EJS Templates
Use setElement to set the view's element properly.
Jonathan Frederic -
Show More
@@ -24,13 +24,12 b' define(["notebook/js/widget"], function(widget_manager){'
24 // Called when view is rendered.
24 // Called when view is rendered.
25 render : function(){
25 render : function(){
26 var that = this;
26 var that = this;
27 this.$el = $("<button />")
27 this.setElement($("<button />")
28 .addClass('btn')
28 .addClass('btn')
29 .click(function() {
29 .click(function() {
30 that.model.set('clicks', that.model.get('clicks') + 1);
30 that.model.set('clicks', that.model.get('clicks') + 1);
31 that.model.update_other_views(that);
31 that.model.update_other_views(that);
32 });
32 }));
33 this._ensureElement();
34
33
35 this.update(); // Set defaults.
34 this.update(); // Set defaults.
36 },
35 },
General Comments 0
You need to be logged in to leave comments. Login now