[Rt-commit] rt branch, 4.0-trunk, updated. rt-4.0.18-64-gedb91f1

Alex Vandiver alexmv at bestpractical.com
Thu Nov 21 18:28:03 EST 2013


The branch, 4.0-trunk has been updated
       via  edb91f1cd09e8cd788b254a2222383545c15c6a0 (commit)
       via  440e25e29bc985f6dc176b8887f0326824939adf (commit)
      from  b1e34c183e8340f1f13cbd82cccce0fd8983f560 (commit)

Summary of changes:
 share/html/NoAuth/js/cascaded.js | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

- Log -----------------------------------------------------------------
commit 440e25e29bc985f6dc176b8887f0326824939adf
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Nov 21 00:10:42 2013 +0800

    use jQuery to do the remove/clone nodes for better compatibility
    
    initial reason is old code has a bug on ie<=8(see also #16629)

diff --git a/share/html/NoAuth/js/cascaded.js b/share/html/NoAuth/js/cascaded.js
index 4a66d5a..5685f56 100644
--- a/share/html/NoAuth/js/cascaded.js
+++ b/share/html/NoAuth/js/cascaded.js
@@ -85,9 +85,7 @@ function filter_cascade_select (id, vals) {
     var children = select.childNodes;
 
     if ( complete_select ) {
-        while (select.hasChildNodes()){
-            select.removeChild(select.firstChild);
-        }
+        jQuery(select).children().remove();
 
         var complete_children = complete_select.childNodes;
 
@@ -100,12 +98,7 @@ function filter_cascade_select (id, vals) {
                 // leave this set of options empty
             } else if ( val == '' ) {
                 // no category, let's clone all node
-                for (i = 0; i < complete_children.length; i++) {
-                    if ( complete_children[i].cloneNode ) {
-                        var new_option = complete_children[i].cloneNode(true);
-                        select.appendChild(new_option);
-                    }
-                }
+                jQuery(select).append(jQuery(complete_children).clone());
                 break;
             }
             else {
@@ -128,10 +121,7 @@ function filter_cascade_select (id, vals) {
                         continue;
                     }
 
-                    if ( complete_children[i].cloneNode ) {
-                        var new_option = complete_children[i].cloneNode(true);
-                        select.appendChild(new_option);
-                    }
+                    jQuery(select).append(jQuery(complete_children[i]).clone());
                 }
 
                 if ( !cloned_empty_label )

commit edb91f1cd09e8cd788b254a2222383545c15c6a0
Merge: b1e34c1 440e25e
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Nov 21 18:27:17 2013 -0500

    Merge branch '4.0/refactor-cf-cascaded-selects-js' into 4.0-trunk


-----------------------------------------------------------------------


More information about the rt-commit mailing list