use non-breaking space for button with no description

to preserve button's size

reverses some inappropriate replacements of .html with .text.

closes #5113
MinRK 12 years ago
parent 3ff0cd79c4
commit c50096334c

@ -103,7 +103,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
var description = this.model.get('description');
if (description.length === 0) {
this.$el.text(' '); // Preserve button height
this.$el.html(" "); // Preserve button height
} else {
this.$el.text(description);
}

@ -32,7 +32,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
// changed by another view or by a state update from the back-end.
var description = this.model.get('description');
if (description.length === 0) {
this.$el.text(' '); // Preserve button height
this.$el.html(" "); // Preserve button height
} else {
this.$el.text(description);
}

@ -137,7 +137,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager) {
});
this.$title = $('<div />')
.addClass('widget-modal-title')
.text(' ')
.html("&nbsp;")
.appendTo(this.$title_bar);
this.$body = $('<div />')
.addClass('modal-body')
@ -147,7 +147,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager) {
.appendTo(this.$window);
this.$show_button = $('<button />')
.text(' ')
.html("&nbsp;")
.addClass('btn btn-info widget-modal-show')
.appendTo(this.$el)
.click(function(){
@ -237,14 +237,14 @@ define(["notebook/js/widgets/widget"], function(WidgetManager) {
// changed by another view or by a state update from the back-end.
var description = this.model.get('description');
if (description.length === 0) {
this.$title.text(' '); // Preserve title height
this.$title.html("&nbsp;"); // Preserve title height
} else {
this.$title.text(description);
}
var button_text = this.model.get('button_text');
if (button_text.length === 0) {
this.$show_button.text(' '); // Preserve button height
this.$show_button.html("&nbsp;"); // Preserve button height
} else {
this.$show_button.text(button_text);
}

@ -33,7 +33,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
this.$droplabel = $('<button />')
.addClass('btn')
.addClass('widget-combo-btn')
.text(' ')
.html("&nbsp;")
.appendTo(this.$buttongroup);
this.$dropbutton = $('<button />')
.addClass('btn')
@ -59,7 +59,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){
if (options === undefined || options.updated_view != this) {
var selected_item_text = this.model.get('value_name');
if (selected_item_text.length === 0) {
this.$droplabel.text(' ');
this.$droplabel.html("&nbsp;");
} else {
this.$droplabel.text(selected_item_text);
}

Loading…
Cancel
Save