Changes from jorisvanzundert for stemweb help text display
[scpubgit/stemmaweb.git] / root / js / componentload.js
index 3abf1a2..8be3210 100644 (file)
@@ -548,8 +548,8 @@ $(document).ready( function() {
 
        $('#stemweb-ui-dialog').dialog({
                autoOpen: false,
-               height: 160,
-               width: 240,
+               height: 'auto',
+               width: 400,
                modal: true,
                buttons: {
                        Run: function (evt) {
@@ -605,8 +605,19 @@ $(document).ready( function() {
                                        // Set up the relevant options for whichever algorithm is chosen.
                                        // "key" -> form name, option ID "stemweb_$key_opt"
                                        // "name" -> form label
+                                       $('#stemweb_algorithm_help').click( function() {
+                                               $('#stemweb_algorithm_desc_text').toggle( 'blind' );
+                                               });
                                        $('#stemweb_algorithm').change( function() {
                                                var pk = $(this).val();
+                                               // Display a link to the popup description, and fill in
+                                               // the description itself, if we have one.
+                                               if( 'desc' in algorithmTypes[pk] ) {
+                                                       $('#stemweb_algorithm_desc_text').empty().append( algorithmTypes[pk].desc );
+                                                       $('#stemweb_algorithm_desc').show();
+                                               } else {
+                                                       $('#stemweb_algorithm_desc').hide();
+                                               }
                                                $('#stemweb_runtime_options').empty();
                                                $.each( algorithmTypes[pk].args, function( i, apk ) {
                                                        var argInfo = algorithmArgs[apk];