You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by ul...@apache.org on 2010/02/26 16:20:08 UTC
svn commit: r916713 - in
/tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src:
main/resources/org/apache/tapestry5/tapestry.js
test/java/org/apache/tapestry5/integration/IntegrationTests.java
Author: uli
Date: Fri Feb 26 15:20:08 2010
New Revision: 916713
URL: http://svn.apache.org/viewvc?rev=916713&view=rev
Log:
TAP5-707: Yellow highlight remains on updated zone if zone is re-updated too quickly
Modified:
tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js
tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java
Modified: tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js?rev=916713&r1=916712&r2=916713&view=diff
==============================================================================
--- tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js (original)
+++ tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js Fri Feb 26 15:20:08 2010
@@ -1348,8 +1348,11 @@
},
/** The classic yellow background fade. */
- highlight : function(element)
+ highlight : function(element, color)
{
+ if(color)
+ return new Effect.Highlight(element, { endcolor: color, restorecolor: color});
+
return new Effect.Highlight(element);
},
@@ -1394,6 +1397,9 @@
this.showFunc = Tapestry.ElementEffect[spec.show] || Tapestry.ElementEffect.show;
this.updateFunc = Tapestry.ElementEffect[spec.update] || Tapestry.ElementEffect.highlight;
+ // TAP5-707: store the old background color of the element or take white as a default
+ this.endcolor = this.element.getStyle('background-color').parseColor('#ffffff');
+
// Link the div back to this zone.
$T(this.element).zoneManager = this;
@@ -1424,7 +1430,7 @@
var func = this.element.visible() ? this.updateFunc : this.showFunc;
- func.call(this, this.element);
+ func.call(this, this.element, this.endcolor);
this.element.fire(Tapestry.ZONE_UPDATED_EVENT);
},
Modified: tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java?rev=916713&r1=916712&r2=916713&view=diff
==============================================================================
--- tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java (original)
+++ tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java Fri Feb 26 15:20:08 2010
@@ -3090,5 +3090,29 @@
assertText("//dd[2]", "Ultra Important");
}
+
+ /**
+ * TAP5-707
+ */
+
+ @Test
+ public void zone_fade_back_backgroundcolor()
+ {
+ start("Form Zone Demo");
+
+ type("longValue", "12");
+
+ click(SUBMIT);
+
+ click(SUBMIT);
+
+ // wait some time to let the fade go away
+ sleep(4050);
+
+ // will only work in firefox.
+ String color = getEval("selenium.browserbot.getCurrentWindow().getComputedStyle(this.page().findElement(\"xpath=//div[@id='valueZone']\"),'').getPropertyValue('background-color').toLowerCase()");
+
+ assertEquals(color, "rgb(255, 255, 255)");
+ }
}