Changeset 1040
- Timestamp:
- Nov 1, 2010, 6:11:23 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r990 r1040 20 20 */ 21 21 class WizardTagLib extends JavascriptTagLib { 22 23 def AuthenticationService 22 def AuthenticationService 24 23 25 24 // define the tag namespace (e.g.: <wizard:action ... /> … … 853 852 def entity = (attrs.get('entity')) 854 853 def template = (entity && entity instanceof TemplateEntity) ? entity.template : null 854 def columnWidths= (attrs.get('columnWidths')) ? attrs.remove('columnWidths') : [] 855 855 856 856 // got a template? … … 867 867 } 868 868 869 out << '<div class="' + attrs.get('class') + '">' + ucName + (it.unit ? " (${it.unit})" : '') 869 // strip spaces 870 def ucNameSpaceless = ucName.replaceAll(/ /) { '' } 871 872 // do we have to use a specific width for this column? 873 if (columnWidths[ucName]) { 874 out << '<div class="' + attrs.get('class') + '" style="width:' + columnWidths[ucNameSpaceless] + 'px;" rel="resized">' + ucName + (it.unit ? " (${it.unit})" : '') 875 } else { 876 out << '<div class="' + attrs.get('class') + '">' + ucName + (it.unit ? " (${it.unit})" : '') 877 } 870 878 if (it.comment) { 871 879 out << '<div class="helpIcon"></div>' -
trunk/grails-app/views/wizard/pages/_groups.gsp
r959 r1040 26 26 <div class="header"> 27 27 <div class="column">Template</div> 28 <div class="column" >Subjects</div>28 <div class="column" style="width:150px;" rel="resized">Subjects</div> 29 29 <g:if test="${study.eventGroups}"><g:each var="eventGroup" in="${study.eventGroups}"> 30 30 <div class="column"> -
trunk/grails-app/views/wizard/pages/_subjects.gsp
r998 r1040 50 50 <div class="header"> 51 51 <div class="firstColumn"></div> 52 <wizard:templateColumnHeaders class="column" entity="${subject}" />52 <wizard:templateColumnHeaders class="column" entity="${subject}" columnWidths="[Name:200, Species: 150]" /> 53 53 </div> 54 54 </g:if> -
trunk/web-app/js/wizard.js
r1037 r1040 248 248 var column = 0; 249 249 var columns = []; 250 var resized = []; 250 251 251 252 // calculate total width of elements in header … … 265 266 266 267 // remember column 268 resized[ column ] = (c.attr('rel') == 'resized'); 267 269 columns[ column ] = c.width(); 268 270 column++; … … 278 280 var column = 0; 279 281 row.children().each(function() { 280 $(this).css({ width: columns[ column] + 'px' }); 282 var child = $(this); 283 child.css({ width: columns[ column] + 'px' }); 284 if (resized[ column ]) { 285 $(':input',child).each(function() { 286 $(this).css({width: (columns[ column ] - 10) + 'px'}); 287 }); 288 } 281 289 column++; 282 290 });
Note: See TracChangeset
for help on using the changeset viewer.