galaxy-dist commit 262c91e3a2ea: Fix 'Select All' button in tool form due to a typo. Values next to checkboxes can now be clicked to check the corresponding box.
# HG changeset patch -- Bitbucket.org # Project galaxy-dist # URL http://bitbucket.org/galaxy/galaxy-dist/overview # User Kanwei Li <kanwei@gmail.com> # Date 1288117861 14400 # Node ID 262c91e3a2ea7d11d65875ec2af42526c92b7123 # Parent bdcbd7ab6e7fe0a6ed869d8a682660c0cebb7658 Fix 'Select All' button in tool form due to a typo. Values next to checkboxes can now be clicked to check the corresponding box. --- a/static/june_2007_style/blue/base.css +++ b/static/june_2007_style/blue/base.css @@ -41,6 +41,7 @@ div.form-row-error{background:#FFCCCC;} div.form-row label{font-weight:bold;display:block;margin-bottom:.2em;} div.form-row-input{float:left;width:300px;} div.form-row-input > input{max-width:300px;} +div.form-row-input label{font-weight:normal;display:inline;} div.form-row-error-message{width:300px;float:left;color:red;font-weight:bold;padding:3px 0 0 1em;} select,input,textarea{font:inherit;font-size:115%;} select,textarea,input[type="text"],input[type="file"],input[type="password"]{-webkit-box-sizing:border-box;max-width:300px;} --- a/templates/tool_form.mako +++ b/templates/tool_form.mako @@ -24,7 +24,7 @@ from galaxy.util.expressions import Expr file.attr( { name: 'replaced_file_input_' + file_name, disabled: true } ); // create a new hidden field which stores the filename and has the original name of the file input var new_file_input = $(document.createElement('input')); - new_file_input.attr( { "type", "hidden", "value": file_value, "name": file_name } ); + new_file_input.attr( { "type": "hidden", "value": file_value, "name": file_name } ); file.after(new_file_input); } }); @@ -36,14 +36,10 @@ from galaxy.util.expressions import Expr location.replace( '${h.url_for( controller='root', action='index', tool_id=tool.id )}' ); } %endif -function checkUncheckAll( name, check ) -{ - if ( check == 0 ) - { +function checkUncheckAll( name, check ) { + if (!check) { $("input[name=" + name + "][type='checkbox']").attr('checked', false); - } - else - { + } else { $("input[name=" + name + "][type='checkbox']").attr('checked', true ); } } @@ -260,7 +256,7 @@ function checkUncheckAll( name, check ) ##inserts the Select All / Unselect All buttons for checkboxes $( function() { $("div.checkUncheckAllPlaceholder").each( function( i ) { - $( this )[0].innerHTML = '<a class="action-button" onclick="checkUncheckAll( \'' + this.attributes.getNamedItem( 'checkbox_name' ).value + '\', 1 );"><span>Select All</span></a><a class="action-button" onclick="checkUncheckAll( \'' + this.attributes.getNamedItem( 'checkbox_name' ).value + '\', 0 );"><span>Unselect All</span></a>'; + $( this )[0].innerHTML = '<a class="action-button" onclick="checkUncheckAll( \'' + this.attributes.getNamedItem( 'checkbox_name' ).value + '\', true );"><span>Select All</span></a><a class="action-button" onclick="checkUncheckAll( \'' + this.attributes.getNamedItem( 'checkbox_name' ).value + '\', false );"><span>Unselect All</span></a>'; }); }); --- a/lib/galaxy/web/form_builder.py +++ b/lib/galaxy/web/form_builder.py @@ -231,14 +231,14 @@ class SelectField(BaseField): rval.append ( '<div class="checkUncheckAllPlaceholder" checkbox_name="%s%s"></div>' % ( prefix, self.name ) ) #placeholder for the insertion of the Select All/Unselect All buttons for text, value, selected in self.options: style = "" + escaped_value = escape( str( value ), quote=True ) if len(self.options) > 2 and ctr % 2 == 1: style = " class=\"odd_row\"" + selected_text = "" if selected: - rval.append( '<div%s><input type="checkbox" name="%s%s" value="%s" checked%s>%s</div>' % \ - ( style, prefix, self.name, escape( str( value ), quote=True ), self.get_disabled_str( disabled ), text ) ) - else: - rval.append( '<div%s><input type="checkbox" name="%s%s" value="%s"%s>%s</div>' % \ - ( style, prefix, self.name, escape( str( value ), quote=True ), self.get_disabled_str( disabled ), text ) ) + selected_text = "checked='checked'" + rval.append( '<div%s><input type="checkbox" name="%s%s" value="%s" id="%s" %s%s><label for="%s">%s</label></div>' % \ + ( style, prefix, self.name, escaped_value, escaped_value, selected_text, self.get_disabled_str( disabled ), escaped_value, text ) ) ctr += 1 return "\n".join( rval ) def get_html_radio( self, prefix="", disabled=False ): --- a/static/june_2007_style/base.css.tmpl +++ b/static/june_2007_style/base.css.tmpl @@ -219,6 +219,11 @@ div.form-row-input > input { max-width: 300px; } +div.form-row-input label { + font-weight: normal; + display: inline; +} + div.form-row-error-message { width: 300px; float: left;
participants (1)
-
commits-noreply@bitbucket.org