prewikka/master: Trigger change event after adding filters.

[email protected]
Newsgroups gmane.comp.security.ids.prelude.cvs
Message-ID <[email protected]>
commit c87e2b8b8f371862c57950f65dfb87ea1788e18b
Author: Yoann Vandoorselaere <[email protected]>
Date:   Wed Jun 3 13:49:27 2009 +0200

    Trigger change event after adding filters.
    
    This is required to display enumeration select box in place of the
    input when the selected path support it.


========================================

 prewikka/templates/AlertListing.tmpl |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

========================================

diff --git a/prewikka/templates/AlertListing.tmpl b/prewikka/templates/AlertListing.tmpl
index 86da711..be5f1ff 100644
--- a/prewikka/templates/AlertListing.tmpl
+++ b/prewikka/templates/AlertListing.tmpl
@@ -316,9 +316,6 @@ function ${type}_set_filter_current() {
    ${type}_special_current();
   #end if
 
-  /* trigger change for each empty filter, so that operator/value are positionned correctly */
-  \$("#${type} table.filter_table tr .popup_select_field").trigger("change");
-
   #set $cnt = 0
   #for $path, $operator, $value in $table
 
@@ -343,6 +340,8 @@ function ${type}_set_filter_current() {
   \$("#$type table.filter_table tr:last .popup_input_field").attr("value", "$utils.escape_attribute($value)");
   \$("#$type table.filter_table tr:last .popup_input_field option[value='$value']").attr("selected", "selected");
   #end for
+
+  \$("#${type} table.filter_table tr .popup_select_field").trigger("change");
  }
  #end for
 
@@ -365,9 +364,6 @@ function ${type}_set_filter_saved() {
    ${type}_special_saved();
   #end if
 
-  /* trigger change for each empty filter, so that operator/value are positionned correctly */
-  \$("#${type} table.filter_table tr .popup_select_field").trigger("change");
-
   #set $cnt = 0
   #for $path, $operator, $value in $table
 
@@ -392,6 +388,8 @@ function ${type}_set_filter_saved() {
   \$("#$type table.filter_table tr:last .popup_input_field").attr("value", "$utils.escape_attribute($value)");
   \$("#$type table.filter_table tr:last .popup_input_field option[value='$value']").attr("selected", "selected");
   #end for
+
+  \$("#${type} table.filter_table tr .popup_select_field").trigger("change");
  }
  #end for
 
_______________________________________________
Prelude-cvslog site list
[email protected]
http://lists.prelude-ids.org/mailman/listinfo/prelude-cvslog
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.