r2569 - photoviewer: small refactoring

r2569 - photoviewer: small refactoring


Author: joern.zaefferer
Date: Thu May 14 01:50:34 2009
New Revision: 2569
Modified:
branches/photoviewer/ui/ui.photoviewer.js
Log:
photoviewer: small refactoring
Modified: branches/photoviewer/ui/ui.photoviewer.js
==============================================================================
--- branches/photoviewer/ui/ui.photoviewer.js    (original)
+++ branches/photoviewer/ui/ui.photoviewer.js    Thu May 14 01:50:34 2009
@@ -140,11 +140,10 @@
        
        _preloadNeighbours: function() {
            var anchors = this._anchors(),
-                index = anchors.index(this.currentAnchor),
-                previous = anchors.filter(":eq(" + (index == 0 ? anchors.length - 1 :
index - 1) + ")"),
-                next = anchors.filter(":eq(" + (index == anchors.length - 1 ? 0 :
index + 1) + ")");
-            new Image().src = previous.attr("href");
-            new Image().src = next.attr("href");
+                index = anchors.index(this.currentAnchor);
+            anchors.filter(":eq(" + (index == 0 ? anchors.length - 1 : index - 1)
+ "), :eq(" + (index == anchors.length - 1 ? 0 : index + 1)
+ ")").each(function() {
+                new Image().src = this.href;
+            });
        },
        
        _position: function(img) {