Author: max
Date: 2007-08-17 05:11:57 -0700 (Fri, 17 Aug 2007)
New Revision: 6110
Modified:
openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
Log:
Change 20070816-maxcarlson-f by [EMAIL PROTECTED] on 2007-08-16 20:44:10 PDT
in /Users/maxcarlson/openlaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: UPDATED: Add flag to only setAttribute() if it the value passed in
changed.
New Features:
Bugs Fixed:
Technical Reviewer: ptw
QA Reviewer: promanik
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Add a flag that only sets the attribute if its value changed. It's a
common pattern to only set an attribute when it changed. With inlining of
setAttribute it will also make sense for performance.
Tests: IWFM
Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
2007-08-17 07:14:15 UTC (rev 6109)
+++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs
2007-08-17 12:11:57 UTC (rev 6110)
@@ -900,9 +900,11 @@
*
* @param String prop: A string naming the key of attribute to set
* @param any val: The value for that attribute
+ * @param Boolean ifchanged: If true, only set the attribute if the value
+ * changed
*/
-function setAttribute(prop, val) {
- if (this.__LZdeleted) return;
+function setAttribute(prop, val, ifchanged) {
+ if (this.__LZdeleted || (ifchanged && (this[prop] == val))) return;
var s = this.setters;
if (s && (prop in s)) {
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins