From: Art Cancro Date: Fri, 1 Dec 2006 05:00:56 +0000 (+0000) Subject: * Fixed a bug in the 'Delete Rule' logic. X-Git-Tag: v7.86~3816 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=00d5940d52cd837d77cd8ca0a7ac6d6217df76f8 * Fixed a bug in the 'Delete Rule' logic. * The 'move rule down' arrow was missing during initial render. Fixed. --- diff --git a/webcit/sieve.c b/webcit/sieve.c index d7642a132..45324730b 100644 --- a/webcit/sieve.c +++ b/webcit/sieve.c @@ -770,9 +770,25 @@ void display_rules_editor_inner_div(void) { " \n" "var highest_active_rule = (-1); \n" " \n" - "function UpdateRules() { \n" - " for (i=0; i<%d; ++i) { \n", MAX_RULES); - wprintf(" d = ($('movedown'+i)); \n" + "function UpdateRules() { \n"); +/* + * Show only the active rows... + */ + wprintf(" highest_active_rule = (-1); \n"); + wprintf(" for (i=0; i<%d; ++i) { \n", MAX_RULES); + wprintf(" if ($('active'+i).checked) { \n" + " $('rule' + i).style.display = 'block'; \n" + " highest_active_rule = i; \n" + " } \n" + " else { \n" + " $('rule' + i).style.display = 'none'; \n" + " } \n" + " } \n"); +/* + * Show only the fields relevant to the rules... + */ + wprintf(" for (i=0; i<=highest_active_rule; ++i) { \n" + " d = ($('movedown'+i)); \n" " if (i < highest_active_rule) { \n" " d.style.display = 'block'; \n" " } \n" @@ -819,20 +835,6 @@ void display_rules_editor_inner_div(void) { " $('div_addrule').style.display = 'none'; \n" " } \n" " } \n" - ); -/* - * Show only the active rows... - */ - wprintf(" highest_active_rule = (-1); \n"); - wprintf(" for (i=0; i<%d; ++i) { \n", MAX_RULES); - wprintf(" if ($('active'+i).checked) { \n" - " $('rule' + i).style.display = 'block'; \n" - " highest_active_rule = i; \n" - " } \n" - " else { \n" - " $('rule' + i).style.display = 'none'; \n" - " } \n" - " } \n" "} \n" /* * Add a rule (really, just un-hide it) @@ -869,8 +871,8 @@ void display_rules_editor_inner_div(void) { * Delete a rule (percolate the deleted rule out to the end, then deactivate it) */ "function DeleteRule(rd) { \n" - " for (i=rd; i