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/04/27 20:36:52 UTC

svn commit: r533212 - in /incubator/xap/trunk: codebase/css/arrow_down.gif codebase/css/arrow_up.gif codebase/src/xap/widgets/dojo/TreeTable.js codebase/src/xap/widgets/dojo/images/ samples/WebContent/examples/widgets/table.xal

Author: mturyn
Date: Fri Apr 27 13:36:51 2007
New Revision: 533212

URL: http://svn.apache.org/viewvc?view=rev&rev=533212
Log:
Reverted way of handling table headers' sorting image to the old way, which doesn't treat them as a button's usual image, since we need to leave a slot in the headers for another image.

Added:
    incubator/xap/trunk/codebase/css/arrow_down.gif   (with props)
    incubator/xap/trunk/codebase/css/arrow_up.gif   (with props)
Removed:
    incubator/xap/trunk/codebase/src/xap/widgets/dojo/images/
Modified:
    incubator/xap/trunk/codebase/src/xap/widgets/dojo/TreeTable.js
    incubator/xap/trunk/samples/WebContent/examples/widgets/table.xal

Added: incubator/xap/trunk/codebase/css/arrow_down.gif
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/css/arrow_down.gif?view=auto&rev=533212
==============================================================================
Binary file - no diff available.

Propchange: incubator/xap/trunk/codebase/css/arrow_down.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/xap/trunk/codebase/css/arrow_up.gif
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/css/arrow_up.gif?view=auto&rev=533212
==============================================================================
Binary file - no diff available.

Propchange: incubator/xap/trunk/codebase/css/arrow_up.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: incubator/xap/trunk/codebase/src/xap/widgets/dojo/TreeTable.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/widgets/dojo/TreeTable.js?view=diff&rev=533212&r1=533211&r2=533212
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/widgets/dojo/TreeTable.js (original)
+++ incubator/xap/trunk/codebase/src/xap/widgets/dojo/TreeTable.js Fri Apr 27 13:36:51 2007
@@ -436,8 +436,10 @@
 					hAlign = "left" ;
 				}
 				// This is another of our widgets, a Button
-				// instance:
-				header.setAlignHorizontal(hAlign) ;
+				// instance; in this case the sorting hint image
+				// is _not_ a standard button image, since we
+				// wish to reserve that place for some other image:
+				header.setTextPlacementHorizontal(hAlign) ;
 				if(header._rootDomNode){	
 					var subnode= header._rootDomNode ;
 					subnode.style.overflow = "hidden" ;
@@ -1201,33 +1203,30 @@
 		this.domNode = document.createElement("col");
 	},
 
-	setSortNone: function( aXapLabel ){
-		var xapLabel = aXapLabel || this._header ;
-//			var oldHint = xapLabel.getImgHint();
-//			dojo.html.removeClass(oldHint,'xapSortDescendingImage');
-//			dojo.html.removeClass(oldHint,'xapSortAscendingImage');	
-//			dojo.html.addClass(oldHint,'xapSortNoneImage');	
-		xapLabel.setImg(this.noneImageUri);
+	setSortNone: function(){
+		var xapLabel = this._header ;
+		var oldHint = xapLabel.getImgHint();
+		dojo.html.removeClass(oldHint,'xapSortDescendingImage');
+		dojo.html.removeClass(oldHint,'xapSortAscendingImage');	
+		dojo.html.addClass(oldHint,'xapSortNoneImage');	
 		delete this._sort ;		
 	},
 	
-	setSortDesc: function( aXapLabel ){
-		var xapLabel = aXapLabel || this._header ;
-//			var oldHint = xapLabel.getImgHint();
-//			dojo.html.removeClass(oldHint,'xapSortNoneImage');
-//			dojo.html.removeClass(oldHint,'xapSortAscendingImage');	
-//			dojo.html.addClass(oldHint,'xapSortDescendingImage');	
-		xapLabel.setImg(this.descImageUri);
+	setSortDesc: function( ){
+		var xapLabel = this._header ;
+		var oldHint = xapLabel.getImgHint();
+		dojo.html.removeClass(oldHint,'xapSortNoneImage');
+		dojo.html.removeClass(oldHint,'xapSortAscendingImage');	
+		dojo.html.addClass(oldHint,'xapSortDescendingImage');	
 		this._sort = "descending" ;		
 	},
 		
-	setSortAsc: function( aXapLabel ){
-		var xapLabel = aXapLabel || this._header ;	
-//			var oldHint = xapLabel.getImgHint();
-//			dojo.html.removeClass(oldHint,'xapSortNoneImage');
-//			dojo.html.removeClass(oldHint,'xapSortDescendingImage');	
-//			dojo.html.addClass(oldHint,'xapSortAscendingImage');	
-		xapLabel.setImg(this.ascImageUri);
+	setSortAsc: function(  ){
+		var xapLabel =  this._header ;	
+		var oldHint = xapLabel.getImgHint();
+		dojo.html.removeClass(oldHint,'xapSortNoneImage');
+		dojo.html.removeClass(oldHint,'xapSortDescendingImage');	
+		dojo.html.addClass(oldHint,'xapSortAscendingImage');	
 		this._sort = "ascending" ;	
 	},	
 	
@@ -1235,15 +1234,6 @@
 	setHeader: function( xapLabel ){
 		this._header = xapLabel;
 		this.setSortNone(); 
-		
-		// Default for headers is image to the right of the
-		// text, opposite sense as for buttons:
-				
-		var hTextToImageAlignment 
-			= xapLabel._horizontalTextToImagePlacement || "left" ;
-		xapLabel.setTextPlacementHorizontal(hTextToImageAlignment) ;	
-
-		xapLabel._showImg();
 //		dojo.event.connect(xapLabel._rootDomNode, "onclick", this, "onClickCallback");
 		dojo.event.connect(xapLabel,"_styleMousedown",this,"onMouseDownCallback") ;
 

Modified: incubator/xap/trunk/samples/WebContent/examples/widgets/table.xal
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/samples/WebContent/examples/widgets/table.xal?view=diff&rev=533212&r1=533211&r2=533212
==============================================================================
--- incubator/xap/trunk/samples/WebContent/examples/widgets/table.xal (original)
+++ incubator/xap/trunk/samples/WebContent/examples/widgets/table.xal Fri Apr 27 13:36:51 2007
@@ -216,12 +216,6 @@
 							comment_a0="Try correcting the next line, it should"
 							comment_a1="overwrite the column value:"
 							horizontalAlignmentt="right"
-							
-							comment_b0="Try correcting the next line, it should"
-							comment_b1="shift the sort-indicator to the left margin:"							
-							horizontalTextToImagePlacementt="right"
-							
-							
 							/>
 						</column>
 						<column  horizontalAlignment="right" width="80px">