mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Change accordion to use a children attribute
This commit is contained in:
parent
18beaff887
commit
41170f7471
@ -26,6 +26,10 @@ define(["notebook/js/widgets/base"], function(widget_manager){
|
|||||||
.attr('id', guid)
|
.attr('id', guid)
|
||||||
.addClass('accordion');
|
.addClass('accordion');
|
||||||
this.containers = [];
|
this.containers = [];
|
||||||
|
for (var i in children) {
|
||||||
|
this.add_child_view(this.child_view(children[i]))
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
update: function() {
|
update: function() {
|
||||||
// Set tab titles
|
// Set tab titles
|
||||||
@ -57,7 +61,7 @@ define(["notebook/js/widgets/base"], function(widget_manager){
|
|||||||
return IPython.WidgetView.prototype.update.call(this);
|
return IPython.WidgetView.prototype.update.call(this);
|
||||||
},
|
},
|
||||||
|
|
||||||
add_child_view: function(attr, view) {
|
add_child_view: function(view) {
|
||||||
|
|
||||||
var index = this.containers.length;
|
var index = this.containers.length;
|
||||||
var uuid = IPython.utils.uuid();
|
var uuid = IPython.utils.uuid();
|
||||||
|
Loading…
Reference in New Issue
Block a user