From 78362df33eae45686a72edd0f13f060aad6c136b Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Tue, 2 Sep 2008 09:53:37 +0000 Subject: [PATCH] make object replacement more clear, set attributes when needed todo update --- README | 2 ++ include/show.js | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/README b/README index f10544b..a433efb 100644 --- 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 diff --git a/include/show.js b/include/show.js index b9ee1a0..3905918 100644 --- a/include/show.js +++ b/include/show.js @@ -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(); }, -- 2.39.2