make object replacement more clear, set attributes when needed
authorEugene Crosser <crosser@average.org>
Tue, 2 Sep 2008 09:53:37 +0000 (09:53 +0000)
committerEugene Crosser <crosser@average.org>
Tue, 2 Sep 2008 09:53:37 +0000 (09:53 +0000)
todo update

README
include/show.js

diff --git a/README b/README
index f10544b2d0ec307a3dea57203768698afacacc74..a433efb9485448a307e66f0d38755802b8acf32e 100644 (file)
--- a/README
+++ b/README
@@ -74,5 +74,7 @@ TODO:
 - make index.html depend of .title and directory timestamps
 - rebuild htmls in .html when directory timestamp chnges (images added)
 - make links in the rss file relative
+- try to make showwin "Extending: Element" and get rid of domelement()
+  dummy getter and getCoordinates() replacement function
 
 Eugene Crosser <crosser at average dot org>
index b9ee1a08d8ef154c1ff26971db1acb92f7744968..39059182c05861c95a48756c1cdb71aab24db12b 100644 (file)
@@ -72,8 +72,6 @@ var Show = new Class({
 
                this.updatecoords();
                this.prevdisplay = new Element('img').
-                       set('class', 'mainformat').
-                       setProperty('alt', 'Current Image').
                        setStyle('opacity', 0).
                        injectInside(this.container.domelement());
                this.ondisplay = this.prevdisplay.clone().
@@ -242,18 +240,20 @@ var Show = new Class({
        },
 
        display: function(cachel){
-               var newstyle = this.calcsize(cachel);
-               var newimg = cachel.img.clone();
-               newimg.setStyles(newstyle);
-               newimg.setStyles({
+               var newimg = cachel.img.clone().
+               set('class', 'mainformat').
+               setProperty('alt', 'Current Image').
+               setStyles(this.calcsize(cachel)).
+               setStyles({
                        zIndex: 3,
                        opacity: 0,
                });
-               this.prevdisplay.dispose();
-               this.prevdisplay = this.ondisplay.clone().
-               setStyle('zIndex', 2).injectInside(this.container.domelement());
-               newimg.replaces(this.ondisplay);
-               this.ondisplay = newimg;
+               this.ondisplay.replaces(this.prevdisplay).
+               setProperty('alt', 'Previous Image').
+               setStyle('zIndex', 2);
+               this.prevdisplay = this.ondisplay;
+               this.ondisplay = newimg.
+               injectInside(this.container.domelement());
                this.effect();
        },