Added ability to title multicontainer pages before multicontainer display()

This commit is contained in:
Jonathan Frederic 2013-10-25 22:45:24 +00:00
parent 510c97679d
commit 6dd1bce589
2 changed files with 24 additions and 18 deletions

View File

@ -14,10 +14,14 @@ require(["notebook/js/widget"], function(){
// Set tab titles
var titles = this.model.get('_titles');
for (var page_index in titles) {
var accordian_toggle = this.containers[page_index]
var accordian = this.containers[page_index]
if (accordian != undefined) {
accordian
.find('.accordion-heading')
.find('.accordion-toggle');
accordian_toggle.html(titles[page_index]);
.find('.accordion-toggle')
.html(titles[page_index]);
}
}
return IPython.WidgetView.prototype.update.call(this);
@ -49,6 +53,7 @@ require(["notebook/js/widget"], function(){
this.containers.push(accordion_group);
accordion_inner.append(view.$el);
this.update();
},
});

View File

@ -160,6 +160,7 @@ class Widget(LoggingConfigurable):
key : unicode (optional)
A single property's name to sync with the frontend.
"""
if self.comm is not None:
state = {}
# If a key is provided, just send the state of that key.