3 | | > |
4 | | > {{{ |
5 | | > #!diff |
6 | | > --- dynamicfieldsplugin/trunk/dynfields/htdocs/rules.js (revision 15591) |
7 | | > +++ dynamicfieldsplugin/trunk/dynfields/htdocs/rules.js (working copy) |
8 | | > @@ -163,9 +163,17 @@ |
9 | | > var target = spec.target; |
10 | | > |
11 | | > // hide field in the header if cleared or always hidden |
12 | | > - var clear_on_hide = spec.clear_on_hide.toLowerCase() == 'true'; |
13 | | > - var hide_always = spec.hide_always.toLowerCase() == 'true' |
14 | | > - if (clear_on_hide || hide_always) { |
15 | | > + //var clear_on_hide = spec.clear_on_hide.toLowerCase() == 'true'; |
16 | | > + var hide_always = spec.hide_always.toLowerCase() == 'true'; |
17 | | > + var v; |
18 | | > + if (input.attr('type') == 'checkbox') |
19 | | > + v = (input.is(':checked')) ? "1" : "0"; |
20 | | > + else |
21 | | > + v = input.val(); |
22 | | > + var l = spec.trigger_value.split('|'); // supports list of trigger values |
23 | | > + var should_hide = ( (jQuery.inArray(v, l) != -1 && spec.op == 'hide') || |
24 | | > + (jQuery.inArray(v, l) == -1 && spec.op == 'show') ) |
25 | | > + if (hide_always || should_hide) { |
26 | | > th = jQuery('#h_' + spec.target); |
27 | | > td = th.next('td'); |
28 | | > td.addClass('dynfields-hide dynfields-' + trigger); |
29 | | > @@ -176,12 +184,6 @@ |
30 | | > return; |
31 | | > |
32 | | > // process hide rule |
33 | | > - var v; |
34 | | > - if (input.attr('type') == 'checkbox') |
35 | | > - v = (input.is(':checked')) ? "1" : "0"; |
36 | | > - else |
37 | | > - v = input.val(); |
38 | | > - var l = spec.trigger_value.split('|'); // supports list of trigger values |
39 | | > if ((jQuery.inArray(v, l) != -1 && spec.op == 'hide') || |
40 | | > (jQuery.inArray(v, l) == -1 && spec.op == 'show')) { |
41 | | > }}} |
42 | | > |
43 | | > When viewing tickets without modifying them, the yellow ticket_box displays the expected ticket properties. There are issues with certain options, however. |
44 | | > |
45 | | > When we used the `invalid_if` option in conjunction with the `invalid_when_type` option we see the behavior of unexpectedly hiding ticket fields. I haven't had a chance to look at why this is occurring. |
46 | | > |
| 3 | > [...] |