Skip to content

Commit

Permalink
#6703 fixed setting list length on easyforms (#6710)
Browse files Browse the repository at this point in the history
* #6703 single selection list size bug fix

* #6703 python default EF list size set to options count
  • Loading branch information
lmitusinski authored and scottdraves committed Jan 24, 2018
1 parent 1fdfd96 commit c59fed6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion beakerx/beakerx/easyform/easyform.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def addList(self, *args, **kwargs):
list = SelectMultipleSingle(
description=self.getDescription(args, kwargs))
list.options = self.getOptions(args, kwargs)
list.size = getValue(kwargs, 'rows', 2)
list.size = getValue(kwargs, 'rows', len(list.options))

self.children += (list,)
self.components[list.description] = list
Expand Down
12 changes: 6 additions & 6 deletions js/notebook/src/easyForm/selectMultipleSingleWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ var SelectMultipleSingleModel = widgets.SelectModel.extend({
var SelectMultipleSingleView = widgets.SelectView.extend({
update: function() {
SelectMultipleSingleView.__super__.update.apply(this);
var items = this.model.get('_options_labels');
if (items && items.length !== undefined) {
$(this.listbox).attr('size', items.length);
$(this.el)
.removeClass('widget-select')
.addClass('widget-select-multiple');
var size = this.model.get('size');
if (size !== undefined) {
$(this.listbox).attr('size', size);
}
$(this.el)
.removeClass('widget-select')
.addClass('widget-select-multiple');
}
});

Expand Down

0 comments on commit c59fed6

Please sign in to comment.