summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/js/htdocs/elemutil.js
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-01-09 03:39:13 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-01-09 03:39:13 +0000
commitbf8b58267edaca28b2306da5300431e5a049896f (patch)
tree1b71c85f52715dc15369388174fd82f97a39b08f /sca-cpp/trunk/modules/js/htdocs/elemutil.js
parent2e9c610931b4e0a6bab25b1fe5dbd0def45ee126 (diff)
Add a composite similar to the travel tutorial app to the sample dashboard. Minor Javascript performance improvements to speed up the layout of big composites.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1056881 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/js/htdocs/elemutil.js')
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/elemutil.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/sca-cpp/trunk/modules/js/htdocs/elemutil.js b/sca-cpp/trunk/modules/js/htdocs/elemutil.js
index 00baab06c8..be976c3982 100644
--- a/sca-cpp/trunk/modules/js/htdocs/elemutil.js
+++ b/sca-cpp/trunk/modules/js/htdocs/elemutil.js
@@ -206,17 +206,21 @@ function selector(s) {
* Return the value of the attribute with the given name.
*/
function namedAttributeValue(name, l) {
- var f = filter(function(v) { return isAttribute(v) && attributeName(v) == name; }, l);
- if (isNil(f))
- return null;
- return caddr(car(f));
+ return memo(l, name, function() {
+ var f = filter(function(v) { return isAttribute(v) && attributeName(v) == name; }, l);
+ if (isNil(f))
+ return null;
+ return caddr(car(f));
+ });
}
/**
* Return child elements with the given name.
*/
function namedElementChildren(name, l) {
- return filter(function(v) { return isElement(v) && elementName(v) == name; }, l);
+ return memo(l, name, function() {
+ return filter(function(v) { return isElement(v) && elementName(v) == name; }, l);
+ });
}
/**