changeset 849:a0ae2d86bcf4 jquery

settings need deep copy to be duplicated
author hertzhaft
date Sun, 06 Mar 2011 14:30:15 +0100
parents 77248c6d2a5f
children 47a6b93bde43
files client/digitallibrary/jquery/jquery-test-embedded.html client/digitallibrary/jquery/jquery.digilib.js
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/jquery/jquery-test-embedded.html	Sun Mar 06 13:16:27 2011 +0100
+++ b/client/digitallibrary/jquery/jquery-test-embedded.html	Sun Mar 06 14:30:15 2011 +0100
@@ -73,9 +73,9 @@
                 var $div = $('div.digilib');
                 $div.digilib(opts);
 
-                $('div.digilib').each(function(){
-                    console.log($(this).data('digilib').settings);
-                    });
+                // $('div.digilib').each(function(){
+                //    console.log($(this).data('digilib').settings);
+                //    });
             });
 
         </script>
--- a/client/digitallibrary/jquery/jquery.digilib.js	Sun Mar 06 13:16:27 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js	Sun Mar 06 14:30:15 2011 +0100
@@ -311,8 +311,8 @@
                             }
                         }
                     }
-                    // store $(this) element in data
-                    elemSettings = $.extend({}, settings, params);
+                    // store $(this) element in data, needs a deep copy
+                    elemSettings = $.extend(true, {}, settings, params);
                     data = {
                             $elem : $elem,
                             settings : elemSettings,