From 8cd71d912654c02d2d3678bb3501caad4b924de8 2015-01-31 05:02:20 From: Nicholas Bollweg Date: 2015-01-31 05:02:20 Subject: [PATCH] firing select.change on option.click --- diff --git a/IPython/html/static/widgets/js/widget_selection.js b/IPython/html/static/widgets/js/widget_selection.js index 77af8a8..c487834 100644 --- a/IPython/html/static/widgets/js/widget_selection.js +++ b/IPython/html/static/widgets/js/widget_selection.js @@ -454,6 +454,7 @@ define([ .text(item) .attr('data-value', encodeURIComponent(item)) .attr('selected_label', item) + .on("click", $.proxy(that.handle_click, that)) .appendTo(that.$listbox); } }); @@ -503,6 +504,13 @@ define([ } }, + handle_click: function (e) { + /** + * Handle when a new value is clicked. + */ + this.$listbox.val($(e.target).val()).change(); + }, + handle_change: function (e) { /** * Handle when a new value is selected.