Patch: clearCache() is not clearing cache completely

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Patch: clearCache() is not clearing cache completely

Anders Johannsen
Hello

The shadowboxCacheKey property on added link elements was not properly deleted in the clearCache() function.  

The patch is against the latest public version of Shadowbox.

Thank you for making this excellent library available.

Anders Johannsen

 % svn diff shadowbox.js
===================================================================
--- shadowbox.js (revision 101)
+++ shadowbox.js (working copy)
@@ -2282,7 +2282,7 @@
         for(var i = 0, len = cache.length; i < len; ++i){
             if(cache[i].el){
                 SL.removeEvent(cache[i].el, 'click', handleClick);
-                delete cache[i].shadowboxCacheKey;
+                delete cache[i].el.shadowboxCacheKey;
             }
         }
         cache = [];