From 5150e6c6b692bc46f98b0deeb5e5025dcb802523 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 16 Sep 2007 00:51:15 +0000 Subject: [PATCH] mujma: BUGFIX: Fixed image flickering under IE6 (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41990 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/ImageEditor/ImageHistory.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/javascript/ImageEditor/ImageHistory.js b/javascript/ImageEditor/ImageHistory.js index ddac0cfa..d4b563fd 100644 --- a/javascript/ImageEditor/ImageHistory.js +++ b/javascript/ImageEditor/ImageHistory.js @@ -33,9 +33,9 @@ ImageHistory = { if(this.operationMade(this.historyPointer-1,'rotate') || this.operationMade(this.historyPointer-1,'crop')) this.modifiedOriginalImage = true; else this.modifiedOriginalImage = false; } - this.image.src = this.history[this.historyPointer-1].fileUrl; - this.historyPointer--; - this.onImageLoad(); + Event.observe('image','load',this.onImageLoad); + this.historyPointer = this.historyPointer - 1; + this.image.src = this.history[this.historyPointer].fileUrl; } else { alert("No more undo"); } @@ -45,9 +45,9 @@ ImageHistory = { if(this.historyPointer < this.history.length-1) { operation = this.history[this.historyPointer+1].operation; if(operation == 'rotate' || operation == 'crop') this.modifiedOriginalImage = true; - this.image.src = this.history[this.historyPointer+1].fileUrl; - this.historyPointer++; - this.onImageLoad(); + Event.observe('image','load',this.onImageLoad); + this.historyPointer = this.historyPointer + 1; + this.image.src = this.history[this.historyPointer].fileUrl; } else { alert("No more redo"); } @@ -111,6 +111,7 @@ ImageHistory = { }, onImageLoad: function(event) { + Event.stopObserving($('image'),'load',this.onImageLoad); imageBox.checkOutOfDrawingArea(this.size[this.historyPointer].width,this.size[this.historyPointer].height); this.image.style.width = this.size[this.historyPointer].width + 'px'; this.image.style.height = this.size[this.historyPointer].height + 'px';