Opened 10 years ago
Closed 6 years ago
#12575 closed defect (fixed)
Fields not hidden in header during preview
| Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
|---|---|---|---|
| Priority: | normal | Component: | DynamicFieldsPlugin |
| Severity: | normal | Keywords: | |
| Cc: | matthewf@… | Trac Release: |
Description
The hidden fields are still visible in the #ticket during preview.
Attachments (2)
Change History (18)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
| Cc: | matthewf@… added |
|---|
comment:3 Changed 8 years ago by
| Owner: | changed from Rob Guttman to Ryan J Ollos |
|---|---|
| Status: | new → accepted |
comment:4 Changed 8 years ago by
| Status: | accepted → new |
|---|
comment:5 Changed 7 years ago by
| Owner: | Ryan J Ollos deleted |
|---|
comment:6 Changed 7 years ago by
Workaround:
-
dynfields/htdocs/dynfields.js
diff --git a/dynfields/htdocs/dynfields.js b/dynfields/htdocs/dynfields.js index 28f1df4d8..84109ca64 100755
a b jQuery(function ($) { 74 74 $(this).change(apply_rules).change(); 75 75 }); 76 76 77 // apply rules on preview 78 $(document).ajaxComplete(function(event, xhr, settings) { 79 if (settings.url === location.pathname) { 80 $.each(inputs, function() { $(this).change() }); 81 } 82 }); 77 83 } 78 84 });
comment:7 Changed 7 years ago by
Thanks for the patch. I tested with Trac 1.0.18dev. There is a minor issue. Using the following config:
[ticket-custom] parents = text parents.label = Parent Tickets parents.hide_when_milestone =
Starting with an empty milestone, change milestone to milestone1. Parents Tickets appears in #properties, but does not appear in #ticket, during explicit preview, auto-preview and after submit. It seems Parent Tickets is always hidden in #ticket.
comment:8 Changed 7 years ago by
It seems that the wrong layout in #ticket is introduced in [15095].
-
dynfields/htdocs/rules.js
168 168 // hide field in the header if cleared or always hidden 169 169 var clear_on_hide = spec.clear_on_hide.toLowerCase() == 'true'; 170 170 var hide_always = spec.hide_always.toLowerCase() == 'true' 171 if (clear_on_hide || hide_always) {172 th = jQuery('#h_' + spec.target);173 td = th.next('td');174 td.addClass('dynfields-hide dynfields-' + trigger);175 th.addClass('dynfields-hide dynfields-' + trigger);176 }177 171 178 172 if (input.attr('id').slice(6) !== spec.trigger) 179 173 return; … … 199 193 th.addClass(cls); 200 194 201 195 // let's also clear out the field's value to avoid confusion 202 if ( spec.clear_on_hide.toLowerCase() == 'true'&&196 if (clear_on_hide && 203 197 field.val() && field.val().length) { // Chrome fix - see #8654 204 198 if (field.attr('type') == 'checkbox') { 205 199 if (field.is(':checked')) { … … 213 207 field.change(); // cascade rules 214 208 } 215 209 } 210 if (clear_on_hide || hide_always) { 211 th = jQuery('#h_' + spec.target); 212 td = th.next('td'); 213 td.addClass('dynfields-hide dynfields-' + trigger); 214 th.addClass('dynfields-hide dynfields-' + trigger); 215 } 216 216 } 217 217 }; 218 218
comment:9 follow-up: 14 Changed 7 years ago by
See also posted patch (dynamicfieldsplugin-v2.diff) in gmessage:trac-users:Bn3rGvLfRVc/aq_aeJWnAQAJ.
comment:10 Changed 7 years ago by
Sorry for delay, I had intended to test and commit, but not sure I will get it done soon. Please feel free to commit the changes, and those in #9606 as well.
comment:11 Changed 6 years ago by
comment:12 Changed 6 years ago by
| Owner: | set to Ryan J Ollos |
|---|---|
| Status: | new → accepted |
Changed 6 years ago by
| Attachment: | dynamicfieldsplugin-v2.diff added |
|---|
Changed 6 years ago by
| Attachment: | dynamicfieldsplugin-v3.diff added |
|---|
comment:14 Changed 6 years ago by
Replying to Jun Omae:
See also posted patch (dynamicfieldsplugin-v2.diff) in gmessage:trac-users:Bn3rGvLfRVc/aq_aeJWnAQAJ.
Rebased the patch: dynamicfieldsplugin-v3.diff. Will do more testing.
comment:16 Changed 6 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |



#13214 closed as a duplicate.