From 41170f7471e873fbbb7ce45bdc906718b68f7dd2 Mon Sep 17 00:00:00 2001 From: Jason Grout Date: Tue, 31 Dec 2013 11:10:58 -0700 Subject: [PATCH] Change accordion to use a children attribute --- IPython/html/static/notebook/js/widgets/multicontainer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/IPython/html/static/notebook/js/widgets/multicontainer.js b/IPython/html/static/notebook/js/widgets/multicontainer.js index 09a2ef52f..c9f8c51c9 100644 --- a/IPython/html/static/notebook/js/widgets/multicontainer.js +++ b/IPython/html/static/notebook/js/widgets/multicontainer.js @@ -26,6 +26,10 @@ define(["notebook/js/widgets/base"], function(widget_manager){ .attr('id', guid) .addClass('accordion'); this.containers = []; + for (var i in children) { + this.add_child_view(this.child_view(children[i])) + } + }, update: function() { // Set tab titles @@ -57,7 +61,7 @@ define(["notebook/js/widgets/base"], function(widget_manager){ return IPython.WidgetView.prototype.update.call(this); }, - add_child_view: function(attr, view) { + add_child_view: function(view) { var index = this.containers.length; var uuid = IPython.utils.uuid();