Skip to content

Commit cc61269

Browse files
committed
Bug Fix: Various UI issues with the new fancy searchable plugin/event param menus.
1 parent d9863fe commit cc61269

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

htdocs/js/app.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,8 +1301,11 @@ app.extend({
13011301
$cont.find(sel).attr({ role: 'button', tabindex: '0', onkeypress: 'app.buttonKey(this,event)' });
13021302

13031303
// also menuize plugin / event params
1304-
if ($cont.hasClass('plugin_param_editor_cont')) SingleSelect.init( $cont.find('select') );
1305-
else SingleSelect.init( $cont.find('div.plugin_param_editor_cont select') );
1304+
var $param_editor_cont = ($cont.hasClass('plugin_param_editor_cont') || $cont.hasClass('info_fieldset')) ? $cont : $cont.find('div.plugin_param_editor_cont');
1305+
if ($param_editor_cont.length) {
1306+
SingleSelect.init( $param_editor_cont.find('select:not([multiple])') );
1307+
MultiSelect.init( $param_editor_cont.find('select[multiple]') );
1308+
}
13061309
},
13071310

13081311
initAccessibility() {

htdocs/js/pages/PageUtils.class.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,18 +2654,18 @@ Page.PageUtils = class PageUtils extends Page.Base {
26542654

26552655
case 'select':
26562656
elem_value = (param.id in params) ? params[param.id] : param.value.replace(/\,.*$/, '').replace(/^.+\[([\w\-\.]+)\]\s*$/, '$1');
2657-
html += self.getFormMenu({ id: elem_id, value: elem_value, options: self.csvToMenuItems(param.value), disabled: elem_dis });
2657+
html += self.getFormMenuSingle({ id: elem_id, value: elem_value, options: self.csvToMenuItems(param.value), disabled: elem_dis, title: param.title });
26582658
break;
26592659

26602660
case 'bucket':
26612661
var bucket = find_object( app.buckets, { id: param.bucket_id } );
26622662
if (bucket) {
26632663
elem_value = (param.id in params) ? params[param.id] : '';
26642664
var menu_opts = self.getBucketMenuItems(bucket.id, param.bucket_path, elem_id, elem_value);
2665-
html += self.getFormMenu({ id: elem_id, value: elem_value, options: menu_opts, disabled: elem_dis });
2665+
html += self.getFormMenuSingle({ id: elem_id, value: elem_value, options: menu_opts, disabled: elem_dis, title: param.title });
26662666
}
26672667
else {
2668-
html += self.getFormMenu({ id: elem_id, value: '', options: [ { id: '', title: "(Bucket Not Found)" } ], disabled: elem_dis });
2668+
html += self.getFormMenuSingle({ id: elem_id, value: '', options: [ { id: '', title: "(Bucket Not Found)" } ], disabled: elem_dis, title: param.title });
26692669
}
26702670
break;
26712671

@@ -2688,7 +2688,14 @@ Page.PageUtils = class PageUtils extends Page.Base {
26882688
elem_value = tool.id;
26892689
}
26902690

2691-
html += self.getFormMenu({ id: elem_id, value: elem_value, options: tools, disabled: elem_dis, onChange: `$P().changePluginParamTool('${plugin_id}','${param.id}',${explore})` });
2691+
html += self.getFormMenuSingle({
2692+
id: elem_id,
2693+
value: elem_value,
2694+
options: tools,
2695+
disabled: elem_dis,
2696+
title: param.title,
2697+
onChange: `$P().changePluginParamTool('${plugin_id}','${param.id}',${explore})`
2698+
});
26922699

26932700
html += `<fieldset id="fs_toolset_${plugin_id}_${param.id}" class="info_fieldset">`;
26942701
html += `<legend>${strip_html(tool.title)}</legend>`;
@@ -2730,7 +2737,7 @@ Page.PageUtils = class PageUtils extends Page.Base {
27302737
var $menu = $('#' + dom_id);
27312738
if (!$menu.length) return; // sanity
27322739

2733-
$menu.html( render_menu_options( items, elem_value, false ) );
2740+
$menu.html( render_menu_options( items, elem_value, false ) ).trigger('change');
27342741
}); // api.get
27352742

27362743
return [ { id: '', title: "..." } ];
@@ -5157,18 +5164,18 @@ Page.PageUtils = class PageUtils extends Page.Base {
51575164

51585165
case 'select':
51595166
elem_value = (param.id in params) ? params[param.id] : param.value.replace(/\,.*$/, '').replace(/^.+\[([\w\-\.]+)\]\s*$/, '$1');
5160-
html += self.getFormMenu({ id: elem_id, value: elem_value, options: self.csvToMenuItems(param.value), disabled: elem_dis });
5167+
html += self.getFormMenuSingle({ id: elem_id, value: elem_value, options: self.csvToMenuItems(param.value), disabled: elem_dis, title: param.title });
51615168
break;
51625169

51635170
case 'bucket':
51645171
var bucket = find_object( app.buckets, { id: param.bucket_id } );
51655172
if (bucket) {
51665173
elem_value = (param.id in params) ? params[param.id] : '';
51675174
var menu_opts = self.getBucketMenuItems(bucket.id, param.bucket_path, elem_id, elem_value);
5168-
html += self.getFormMenu({ id: elem_id, value: elem_value, options: menu_opts, disabled: elem_dis });
5175+
html += self.getFormMenuSingle({ id: elem_id, value: elem_value, options: menu_opts, disabled: elem_dis, title: param.title });
51695176
}
51705177
else {
5171-
html += self.getFormMenu({ id: elem_id, value: '', options: [ { id: '', title: "(Bucket Not Found)" } ], disabled: elem_dis });
5178+
html += self.getFormMenuSingle({ id: elem_id, value: '', options: [ { id: '', title: "(Bucket Not Found)" } ], disabled: elem_dis, title: param.title });
51725179
}
51735180
break;
51745181

0 commit comments

Comments
 (0)