From 7b94a2e2cb6d9962b5063fcbfab7654831285b2f 2014-02-04 01:15:06 From: MinRK Date: 2014-02-04 01:15:06 Subject: [PATCH] Make `SelectionWidget.values` a dict rename 'labels' and '_value' to 'value_names' and 'value_name'. To specify a mapping of value names and values, use a dict. If you specify `values=[list]`, then an OrderedDict will be used. Assignment after construction only supports a dict. --- diff --git a/IPython/html/static/notebook/js/widgets/widget_selection.js b/IPython/html/static/notebook/js/widgets/widget_selection.js index 5d9791c..30c7ce4 100644 --- a/IPython/html/static/notebook/js/widgets/widget_selection.js +++ b/IPython/html/static/notebook/js/widgets/widget_selection.js @@ -57,14 +57,14 @@ define(["notebook/js/widgets/widget"], function(WidgetManager){ // changed by another view or by a state update from the back-end. if (options === undefined || options.updated_view != this) { - var selected_item_text = this.model.get('_value'); + var selected_item_text = this.model.get('value_name'); if (selected_item_text.length === 0) { this.$droplabel.text(' '); } else { this.$droplabel.text(selected_item_text); } - var items = this.model.get('labels'); + var items = this.model.get('value_names'); var $replace_droplist = $('