mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
Make sure backbone events fire.
If $el is set to something else, make sure all the backbone machinery knows about the new DOM element.
This commit is contained in:
parent
b7e1797fd2
commit
f16f1d6537
@ -23,7 +23,7 @@ define(["notebook/js/widget"], function(widget_manager){
|
||||
|
||||
// Called when view is rendered.
|
||||
render : function(){
|
||||
this.$el = $('<div />')
|
||||
this.$el
|
||||
.addClass('widget-hbox-single');
|
||||
this.$label = $('<div />')
|
||||
.addClass('widget-hlabel')
|
||||
@ -74,7 +74,6 @@ define(["notebook/js/widget"], function(widget_manager){
|
||||
render : function(){
|
||||
this.$el
|
||||
.html('');
|
||||
|
||||
this.$button = $('<button />')
|
||||
.addClass('btn')
|
||||
.attr('type', 'button')
|
||||
|
@ -30,6 +30,7 @@ define(["notebook/js/widget"], function(widget_manager){
|
||||
that.model.set('clicks', that.model.get('clicks') + 1);
|
||||
that.model.update_other_views(that);
|
||||
});
|
||||
this._ensureElement();
|
||||
|
||||
this.update(); // Set defaults.
|
||||
},
|
||||
|
@ -21,7 +21,7 @@ define(["notebook/js/widget"], function(widget_manager) {
|
||||
var ContainerView = IPython.WidgetView.extend({
|
||||
|
||||
render: function(){
|
||||
this.$el = $('<div />')
|
||||
this.$el =
|
||||
.addClass('widget-container');
|
||||
},
|
||||
|
||||
|
@ -23,6 +23,7 @@ define(["notebook/js/widget"], function(widget_manager){
|
||||
render: function(){
|
||||
this.$el = $('<div />', {id: IPython.utils.uuid()})
|
||||
.addClass('accordion');
|
||||
this._ensureElement();
|
||||
this.containers = [];
|
||||
},
|
||||
|
||||
@ -102,7 +103,6 @@ define(["notebook/js/widget"], function(widget_manager){
|
||||
var TabView = IPython.WidgetView.extend({
|
||||
|
||||
render: function(){
|
||||
this.$el = $('<div />');
|
||||
var uuid = IPython.utils.uuid();
|
||||
var that = this;
|
||||
this.$tabs = $('<div />', {id: uuid})
|
||||
|
@ -22,7 +22,6 @@ define(["notebook/js/widget"], function(widget_manager){
|
||||
|
||||
// Called when view is rendered.
|
||||
render : function(){
|
||||
this.$el = $('<div />');
|
||||
this.update(); // Set defaults.
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user