You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by mt...@apache.org on 2007/03/27 17:46:30 UTC
svn commit: r523014 -
/incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js
Author: mturyn
Date: Tue Mar 27 10:46:29 2007
New Revision: 523014
URL: http://svn.apache.org/viewvc?view=rev&rev=523014
Log:
Guarded against bug when attempting to add class to a widget which is missing one or more of the nodes we'd expect to style.
So far, not doing anything in that case; later we should schedule another attempt to add the class later on.
Modified:
incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js
Modified: incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js?view=diff&rev=523014&r1=523013&r2=523014
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js (original)
+++ incubator/xap/trunk/codebase/src/xap/bridges/basic/AbstractWidgetBridge.js Tue Mar 27 10:46:29 2007
@@ -325,7 +325,13 @@
// Assume root dom node is included in the map as nodeMap[""]---legal,
// surprisingly:
for(var nodeLabel in nodeMap){
- this._addStyleStateToOneNode( pStateName, nodeMap[nodeLabel], nodeLabel );
+ var node = nodeMap[nodeLabel] ;
+ if( !node ){
+ // TODO handle this more gracefully---a delayed
+ // addition later on when there _is_ a node?
+ continue ;
+ }
+ this._addStyleStateToOneNode( pStateName, node, nodeLabel );
}
}
@@ -333,6 +339,12 @@
var nodeMap = this.getStylingNodesMap() ;
// Assume root dom node is included in the map as nodeMap[""]---legal.
for(var nodeLabel in nodeMap){
+ var node = nodeMap[nodeLabel] ;
+ if( !node ){
+ // TODO handle this more gracefully---a delayed
+ // removal later on when there _is_ a node?
+ continue ;
+ }
this._removeStyleStateFromOneNode( pStateName, nodeMap[nodeLabel], nodeLabel );
}
}
@@ -923,9 +935,15 @@
var nodeMap = this.getStylingNodesMap() ;
for(var nodeLabel in nodeMap){
+ var node = nodeMap[nodeLabel] ;
+ if( !node ){
+ // TODO handle this more gracefully---a delayed
+ // addition later on when there _is_ a node?
+ continue ;
+ }
for( var idx=0; idx<arrClassStr.length ; ++idx){
- // For example: aButton.contentsNode myStyleContents
- dojo.html.addClass(nodeMap[nodeLabel],arrClassStr[idx]+nodeLabel);
+ // For example: aButton.contentsNode --> myStyleContents
+ dojo.html.addClass( node ,arrClassStr[idx]+nodeLabel);
}
}
}
@@ -1005,10 +1023,14 @@
// Assume root dom node is included in the map as nodeMap[""]---legal,
// surprisingly:
for(var nodeLabel in nodeMap){
+ var node = nodeMap[nodeLabel] ;
+ if( !node ){
+ continue ;
+ }
for(var jj=0; jj<iClasses.length; ++jj){
for( var ii=0; ii<possibleStates.length; ++ii){
dojo.html.removeClass(
- nodeMap[nodeLabel],
+ node,
iClasses[jj] +nodeLabel + possibleStates[ii]
);
}