From 59e7a04723ee3255a8e7dbd3626ae2fabe58a269 Mon Sep 17 00:00:00 2001 From: Jonathan Frederic Date: Thu, 14 Nov 2013 23:23:00 +0000 Subject: [PATCH] Added support for multiple spaces in a row also added button height fix for standard buttons without a caption --- IPython/html/static/notebook/js/widgets/button.js | 7 ++++--- IPython/html/static/notebook/js/widgets/selection.js | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/IPython/html/static/notebook/js/widgets/button.js b/IPython/html/static/notebook/js/widgets/button.js index 6bfb71111..862d488a3 100644 --- a/IPython/html/static/notebook/js/widgets/button.js +++ b/IPython/html/static/notebook/js/widgets/button.js @@ -38,10 +38,11 @@ define(["notebook/js/widget"], function(){ // Frontent -> Frontend Sync update : function(){ var description = this.model.get('description'); - if (description.length==0) { - this.$el.html(' '); // Preserve button height + description.replace(' ', ' ') + if (description.length == 0) { + this.$el.html(' '); // Preserve button height } else { - this.$el.html(description); + this.$el.html(this.model.get('description')); } return IPython.WidgetView.prototype.update.call(this); diff --git a/IPython/html/static/notebook/js/widgets/selection.js b/IPython/html/static/notebook/js/widgets/selection.js index d515fb0b7..159649ec0 100644 --- a/IPython/html/static/notebook/js/widgets/selection.js +++ b/IPython/html/static/notebook/js/widgets/selection.js @@ -60,8 +60,8 @@ define(["notebook/js/widget"], function(){ update : function(){ var selected_item_text = this.model.get('value'); - selected_item_text.replace(' ', ''); - if (selected_item_text == '') { + selected_item_text.replace(' ', ' '); + if (selected_item_text.length == 0) { this.$droplabel.html(' '); } else { this.$droplabel.html(this.model.get('value'));