commit/galaxy-central: 3 new changesets
3 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/4cfd8885a743/ Changeset: 4cfd8885a743 User: jmchilton Date: 2013-03-07 18:16:53 Summary: select2 fixes for workflow running. Affected #: 1 file diff -r e3ae0bbd800a68532fc51625642e0abc29e1b085 -r 4cfd8885a74319559b1c31896dcfe64afd60bb87 templates/webapps/galaxy/workflow/run.mako --- a/templates/webapps/galaxy/workflow/run.mako +++ b/templates/webapps/galaxy/workflow/run.mako @@ -8,7 +8,7 @@ <%def name="javascripts()"> ${parent.javascripts()} - ${h.js( "libs/jquery/jquery.autocomplete" )} + ${h.js( "libs/jquery/select2" )} <script type="text/javascript"> $( function() { function show_tool_body(title){ @@ -40,12 +40,12 @@ select.val($('option:last', select).val()); } select.closest('.form-row').children('label').children('span.mode-icon').hide(); - select.removeAttr('multiple').removeAttr('size'); + select.removeAttr('multiple').select2().removeAttr('size'); placeholder = 'type to filter'; } else { $('.multiinput', select.closest('.form-row')).removeClass('disabled'); select.closest('.form-row').children('label').children('span.mode-icon').show(); - select.attr('multiple', 'multiple').attr('size', 8); + select.attr('multiple', 'multiple').select2().attr('size', 8); placeholder = 'type to filter, [enter] to select all'; } $('input.multiinput-filter', select.parent()).attr( @@ -79,7 +79,7 @@ $("#new_history_cbx").click(function(){ $("#new_history_input").toggle(this.checked); }); - $('span.multiinput_wrap select[name*="|input"]').removeAttr('multiple').each(function(i, s) { + $('span.multiinput_wrap select[name*="|input"]').removeAttr('multiple').select2().each(function(i, s) { var select = $(s); var new_width = Math.max(200, select.width()) + 20; // Find the label for this element. https://bitbucket.org/galaxy/galaxy-central/commits/d92b3bbccbfb/ Changeset: d92b3bbccbfb User: jmchilton Date: 2013-03-07 20:42:11 Summary: Abstract away logic for updating select boxes. For multiple select boxes set closeOnSelect to false, this vastly reduces the clicking required to select many items. Affected #: 2 files diff -r 4cfd8885a74319559b1c31896dcfe64afd60bb87 -r d92b3bbccbfb56c0c0b2cf203796a2d37e532ff3 static/scripts/galaxy.base.js --- a/static/scripts/galaxy.base.js +++ b/static/scripts/galaxy.base.js @@ -239,6 +239,14 @@ return 0; } +$.fn.refresh_select2 = function() { + var select_elt = $(this); + var options = { width: "resolve", + closeOnSelect: !select_elt.is("[MULTIPLE]"), + }; + return select_elt.select2( options ); +} + // Replace select box with a text input box + autocomplete. function replace_big_select_inputs(min_length, max_length, select_elts) { // To do replace, the select2 plugin must be loaded. @@ -276,9 +284,7 @@ * * - should we still sort dbkey fields here? */ - - select_elt.select2( { width: "resolve" } ); - + select_elt.refresh_select2(); }); } diff -r 4cfd8885a74319559b1c31896dcfe64afd60bb87 -r d92b3bbccbfb56c0c0b2cf203796a2d37e532ff3 templates/webapps/galaxy/workflow/run.mako --- a/templates/webapps/galaxy/workflow/run.mako +++ b/templates/webapps/galaxy/workflow/run.mako @@ -40,12 +40,12 @@ select.val($('option:last', select).val()); } select.closest('.form-row').children('label').children('span.mode-icon').hide(); - select.removeAttr('multiple').select2().removeAttr('size'); + select.removeAttr('multiple').refresh_select2().removeAttr('size'); placeholder = 'type to filter'; } else { $('.multiinput', select.closest('.form-row')).removeClass('disabled'); select.closest('.form-row').children('label').children('span.mode-icon').show(); - select.attr('multiple', 'multiple').select2().attr('size', 8); + select.attr('multiple', 'multiple').refresh_select2().attr('size', 8); placeholder = 'type to filter, [enter] to select all'; } $('input.multiinput-filter', select.parent()).attr( @@ -79,7 +79,7 @@ $("#new_history_cbx").click(function(){ $("#new_history_input").toggle(this.checked); }); - $('span.multiinput_wrap select[name*="|input"]').removeAttr('multiple').select2().each(function(i, s) { + $('span.multiinput_wrap select[name*="|input"]').removeAttr('multiple').refresh_select2().each(function(i, s) { var select = $(s); var new_width = Math.max(200, select.width()) + 20; // Find the label for this element. https://bitbucket.org/galaxy/galaxy-central/commits/d71a574758c9/ Changeset: d71a574758c9 User: dannon Date: 2013-03-27 16:53:18 Summary: Merged in galaxyp/galaxy-central-parallelism-refactorings (pull request #136) select2 fixes for workflow running. Affected #: 2 files diff -r 3826fb2deb717d7fce67e3b6351cd39c61b07379 -r d71a574758c9e49cbbdf889e5926c105745ef860 static/scripts/galaxy.base.js --- a/static/scripts/galaxy.base.js +++ b/static/scripts/galaxy.base.js @@ -239,6 +239,14 @@ return 0; } +$.fn.refresh_select2 = function() { + var select_elt = $(this); + var options = { width: "resolve", + closeOnSelect: !select_elt.is("[MULTIPLE]"), + }; + return select_elt.select2( options ); +} + // Replace select box with a text input box + autocomplete. function replace_big_select_inputs(min_length, max_length, select_elts) { // To do replace, the select2 plugin must be loaded. @@ -276,9 +284,7 @@ * * - should we still sort dbkey fields here? */ - - select_elt.select2( { width: "resolve" } ); - + select_elt.refresh_select2(); }); } diff -r 3826fb2deb717d7fce67e3b6351cd39c61b07379 -r d71a574758c9e49cbbdf889e5926c105745ef860 templates/webapps/galaxy/workflow/run.mako --- a/templates/webapps/galaxy/workflow/run.mako +++ b/templates/webapps/galaxy/workflow/run.mako @@ -8,7 +8,7 @@ <%def name="javascripts()"> ${parent.javascripts()} - ${h.js( "libs/jquery/jquery.autocomplete" )} + ${h.js( "libs/jquery/select2" )} <script type="text/javascript"> $( function() { function show_tool_body(title){ @@ -40,12 +40,12 @@ select.val($('option:last', select).val()); } select.closest('.form-row').children('label').children('span.mode-icon').hide(); - select.removeAttr('multiple').removeAttr('size'); + select.removeAttr('multiple').refresh_select2().removeAttr('size'); placeholder = 'type to filter'; } else { $('.multiinput', select.closest('.form-row')).removeClass('disabled'); select.closest('.form-row').children('label').children('span.mode-icon').show(); - select.attr('multiple', 'multiple').attr('size', 8); + select.attr('multiple', 'multiple').refresh_select2().attr('size', 8); placeholder = 'type to filter, [enter] to select all'; } $('input.multiinput-filter', select.parent()).attr( @@ -79,7 +79,7 @@ $("#new_history_cbx").click(function(){ $("#new_history_input").toggle(this.checked); }); - $('span.multiinput_wrap select[name*="|input"]').removeAttr('multiple').each(function(i, s) { + $('span.multiinput_wrap select[name*="|input"]').removeAttr('multiple').refresh_select2().each(function(i, s) { var select = $(s); var new_width = Math.max(200, select.width()) + 20; // Find the label for this element. Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org