mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
Added support for multiple lines in button-like widgets
This commit is contained in:
parent
59e7a04723
commit
6c860e32c0
@ -38,11 +38,12 @@ define(["notebook/js/widget"], function(){
|
||||
// Frontent -> Frontend Sync
|
||||
update : function(){
|
||||
var description = this.model.get('description');
|
||||
description.replace(' ', ' ')
|
||||
description = description.replace(' ', ' ');
|
||||
description = description.replace('\n', '<br>\n');
|
||||
if (description.length == 0) {
|
||||
this.$el.html(' '); // Preserve button height
|
||||
} else {
|
||||
this.$el.html(this.model.get('description'));
|
||||
this.$el.html(description);
|
||||
}
|
||||
|
||||
return IPython.WidgetView.prototype.update.call(this);
|
||||
|
@ -60,11 +60,12 @@ define(["notebook/js/widget"], function(){
|
||||
update : function(){
|
||||
|
||||
var selected_item_text = this.model.get('value');
|
||||
selected_item_text.replace(' ', ' ');
|
||||
selected_item_text = selected_item_text.replace(' ', ' ');
|
||||
selected_item_text = selected_item_text.replace('\n', '<br>\n');
|
||||
if (selected_item_text.length == 0) {
|
||||
this.$droplabel.html(' ');
|
||||
} else {
|
||||
this.$droplabel.html(this.model.get('value'));
|
||||
this.$droplabel.html(selected_item_text);
|
||||
}
|
||||
|
||||
var items = this.model.get('values');
|
||||
|
Loading…
Reference in New Issue
Block a user