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/05/23 19:02:33 UTC

svn commit: r541031 - in /incubator/xap/trunk/codebase: css/xapDefault.css src/xap/widgets/dojo/TreeTable.js

Author: mturyn
Date: Wed May 23 12:02:33 2007
New Revision: 541031

URL: http://svn.apache.org/viewvc?view=rev&rev=541031
Log:
Keeps header cell boundaries visible by making sizers visible.  Because they're now visible, the must be thinner---1px.

Modified:
    incubator/xap/trunk/codebase/css/xapDefault.css
    incubator/xap/trunk/codebase/src/xap/widgets/dojo/TreeTable.js

Modified: incubator/xap/trunk/codebase/css/xapDefault.css
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/css/xapDefault.css?view=diff&rev=541031&r1=541030&r2=541031
==============================================================================
--- incubator/xap/trunk/codebase/css/xapDefault.css (original)
+++ incubator/xap/trunk/codebase/css/xapDefault.css Wed May 23 12:02:33 2007
@@ -237,23 +237,26 @@
 }
 
 .xapHeaderContents{
-	overflow:hidden;	
+	overflow:hidden;
 }
 /* TABLE COLUMNS SIZERS: */
 
 .xapTableStationarySizers {
 	cursor: move;
 	cursor: w-resize;
-	width: 3px ;
+	width: 0px ;
 	/* Can't set it to "transparent" because
 	   that removes selectability under IE7;
 	   Instead, apply it in code to IE6, 
 	   which is the only place it's needed;
 	   the opacity/filter stuff works fine
-	   in Firefox and IE7
+	   in Firefox and IE7.
+	Now:  don't even want to make it transparent,
+	we're seeing the (now thin) sizers:
 	*/
 	
-	background-color: white ;
+	#background-color: #darkcyan ;
+	background-color: #aaaaaa ;
 	border-right:0px solid white;
 	border-left: 0px  solid white;
 	-moz-opacity: 0.91;

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=541031&r1=541030&r2=541031
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/widgets/dojo/TreeTable.js (original)
+++ incubator/xap/trunk/codebase/src/xap/widgets/dojo/TreeTable.js Wed May 23 12:02:33 2007
@@ -65,7 +65,7 @@
 	this._initialResizePending = true;
 	
 	// width of each column sizer, in pixels:
-	this._sizerWidth = 8 ;
+	this._sizerWidth = 1;
 
 };
 
@@ -353,7 +353,7 @@
 			//...so use this:
 			var nWidth = parseInt(width) ;
 
-			width = (nWidth  )+"px" ;
+			width = (nWidth)+"px" ;
 
 			var widthObj = {width: nWidth};
 		
@@ -385,7 +385,7 @@
 				}
 				if(this.table.childNodes[i]){
 					widthObj = dojo.html.getMarginBox( this.headerTable.childNodes[i]) ;
-					delete widthObj.height ;										
+					delete widthObj.height ;															
 					dojo.html.setMarginBox(
 										this.table.childNodes[i],
 										widthObj
@@ -520,7 +520,7 @@
 		
 	
 		this.headerTable.cellPadding = "0px";
-		this.headerTable.cellSpacing= "0px";
+		this.headerTable.cellSpacing = "0px";
 		
 		//populate cols under both tables
 		for (var i = 0; i<this._columns.length; i++){
@@ -909,7 +909,7 @@
 				||!this.domNode.clientHeight
 			){
 			return ;
-		}//foo
+		}
 		
 		//cancel any partial rebuild tasks
 		if (this._onResizedTask){
@@ -1258,7 +1258,6 @@
 	// a split container instead of a table row---should make
 	// things much simpler here:
 	_renewColumnSizers: function(){   //debug::this.loggit('_renewColumnSizers') ;
-
 		if( !this.headerDiv || !this._columns|| this._columns.length==0 ){
 			return ;
 		}
@@ -1319,18 +1318,17 @@
 
 		splitterContainerStyle.zIndex = 0 ;
 		
-		var borderFudge = null ;		
 
 		var h = this.domNode.offsetHeight +"px" ;
 								
-															
+		// Add a splitter panel for each header:								
 		for (var ii = 0; ii<this.headerRow.childNodes.length; ++ii){
 			var node = this.headerRow.childNodes[ii] ;
-			var box = dojo.html.getMarginBox(node) ;		
+			var box = dojo.html.getMarginBox(node) ;
 			this._addSplitPane(box) ;
 		}		
 								
-		// Add an additional sizer for any space that might 
+		// Add an additional panel for any space that might 
 		// exist between the last true column and the right
 		// edge of the table:
 		var box = {height: this.headerDiv.clientHeight,
@@ -1344,11 +1342,11 @@
 // many of them, and appears to be unneeded:
 //		this.columnsSizer.postCreate() ;
 
-		dojo.lang.setTimeout(this,this._applyBasicSizerStyling,600) ;
+		dojo.lang.setTimeout(this,this._applyBasicSizerStyling,0) ;
 
 		
 		//this.columnsSizer._layoutPanels();
-		this._hideSplitterPanelsAndShowSizers(0) ;
+
 		
 		
 		// Trigger out methods when the splitter 
@@ -1365,11 +1363,9 @@
 							this,
 							this.onBeginSizing
 							) ;
-						
-		this._redoSplitPanelStyling(0) ;
-		// The results we get after dragging seem better:
-
-		this.onEndSizing() ;
+		this._redoSplitPanelStyling();
+//		dojo.lang.setTimeout(this,this.onEndSizing,200) ;
+		this.onEndSizing();
 	},	
 	
 	_applyBasicSizerStyling: function(){
@@ -1387,7 +1383,7 @@
 //*debug*/ 	dojo.html.addClass(aSizer, "sizer_"+idx) ;
 			aSizer.style.visibility="hidden" ;		
 			aSizer.style.height = 
-				(this.headerTable.offsetHeight) +"px" ;			
+				/*(this.headerRow.clientHeight)*/0 +"px" ;			
 			dojo.html.removeClass(aSizer, "dojoSplitContainerSizerH") ;
 			dojo.html.addClass(aSizer, "xapTableStationarySizers") ;
 			// No need to see the sizers; they should
@@ -1405,9 +1401,9 @@
 
 // debug sizer visibility by increasing opacity to (say) 30/0.3:				
 			if( dojo.render.html.ie ){
-				aSizer.style.filter = "alpha(opacity=0)" ;				
+				aSizer.style.filter = "alpha(opacity=100)" ;				
 			} else {
-				aSizer.style.opacity = 0.0 ;				
+				aSizer.style.opacity = 1.0 ;				
 			}
 			
 			this._fixSizerWidthAndPosition(idx) ;
@@ -1425,15 +1421,20 @@
 			var sizerNode = this.columnsSizer.sizers[index] ;
 			var left = null ;
 			if( index < this.headerRow.childNodes.length - 1 ){	
-				left = this.headerRow.childNodes[index+1].offsetLeft ;
+				left 
+					= this.headerRow.childNodes[index+1].offsetLeft ;
 			} else {
 				// Pseudo-column at the end:
 				left= this.headerRow.scrollWidth ;						
 			}
+			// Now we're setting the sizer to be visible (see )
+			// and it's only 1px wide; if we went back to the older way
+			// (wider invisible sizers centred about the proper line)
+			// we'll need that (width/2) factor---innoccuous now:
 			sizerNode.style.left 
-				= (left -Math.round(this._sizerWidth/2)) +"px";	
+				= (left -Math.floor(this._sizerWidth/2)) +"px";	
 			sizerNode.style.width=this._sizerWidth +"px" ;
-			sizerNode.style.height = this.headerTable.offsetHeight+"px";				
+			sizerNode.style.height = this.headerRow.clientHeight+"px";				
 	},
 
 
@@ -1500,7 +1501,11 @@
 		}
 		sizer._layoutPanels() ;
 		
-		this._hideSplitterPanelsAndShowSizers(500) ;
+		if( dojo.render.html.ie ){
+			this._hideSplitterPanelsAndShowSizers(500) ;
+		} else {
+			this._hideSplitterPanelsAndShowSizers() ;
+		}
 	},
 
 	_hideSplitterPanelsAndShowSizers: function(delay){   //debug::this.loggit('_hideSplitterPanelsAndShowSizers') ;
@@ -1526,13 +1531,15 @@
 			this._hideSplitterPanelsAndShowSizersTask = null ;
 		}
 		
+		this._applyBasicSizerStyling() ;
+		
 		// Figure out now if we'r in a browser
 		// that will need an explicitly transparent
 		// background colour---IE6 under XP
 		var isXpIe6 = 
 			dojo.render.html.ie60 &&
 			( dojo.render.html.UA.indexOf("Windows NT 5.1") != -1 ) ;		
-	
+
 		var sizer = this.columnsSizer ;
 		var parent = this.columnsSizer.domNode ;
 		var sizerHandles = sizer.sizers ;
@@ -1552,19 +1559,20 @@
 			var sizerHandleStyle = sizerHandle.style ;
 			sizerHandleStyle.visibility = "visible" ;
 			sizerHandleStyle.zIndex = 0 ;
-
-			if(isXpIe6){
-				/* Can't set it to "transparent" in CSS because
-				   because that removes selectability under IE7;
-				   ---instead, apply it in code to IE6/XP, which is
-				   the only place it's needed,as the stylesheet's
-				   {0 opacity} xor {alpha-filter stuff} works fine in Fire-
-				   fox, IE7, and IE6/Win2K.foo
-				*/
-				// To debug, you'll probably want to
-				// set this to something more noticeable:		
-				sizerHandleStyle.backgroundColor="transparent" ;		
-			}			
+			
+// Now, sizers are thin (1px) and visible:
+//			if(isXpIe6){
+//				/* Can't set it to "transparent" in CSS because
+//				   because that removes selectability under IE7;
+//				   ---instead, apply it in code to IE6/XP, which is
+//				   the only place it's needed,as the stylesheet's
+//				   {0 opacity} xor {alpha-filter stuff} works fine in Fire-
+//				   fox, IE7, and IE6/Win2K.
+//				*/
+//				// To debug, you'll probably want to
+//				// set this to something more noticeable:		
+//				sizerHandleStyle.backgroundColor="transparent" ;		
+//			}			
 		}	
 
 		var headers = this.headerRow.childNodes ;		
@@ -1641,7 +1649,8 @@
 		dojo.html.removeClass( dragger, "dojoSplitContainerVirtualSizerH" ) ;
 		dojo.html.addClass( dragger, "xapTableMovingSizer" ) ;
 		// Can't cache: table height might changed
-		dragger.style.height = this.domNode.offsetHeight+"px" ;
+		dragger.style.height 
+			= (this.scrollDiv.offsetHeight + this.headerDiv.clientHeight)+"px" ;
 		dragger.style.width = "1px" ;
 		// Bring splitter container to front so
 		// that we're not getting the column mouseover effects:
@@ -1651,6 +1660,8 @@
 
 	onEndSizing: function(e){   //debug::this.loggit('onEndSizing') ;
 		dojo.html.removeClass( this.columnsSizer.virtualSizer, "xapTableMovingSizer" ) ;	
+		// Was set to "visible" to show taller-than-header dragging sizer:
+		this.splitterContainer.style.overflow = "hidden" ;			
 		
 		// user grabbed the last sizer:
 		if( this._grabbedTheLastSizer && this._lastTableRightPx ){
@@ -1766,13 +1777,7 @@
 	
 	        this.sizers[i] = document.createElement('div');
 	        this.sizers[i].style.position = 'absolute';
-	        /* Altered:*/
-// debug sizer visibility by increasing opacity to (say) 30/0.3:				
-			if( dojo.render.html.ie ){
-				this.sizers[i].style.filter = "alpha(opacity=0)" ;				
-			} else {
-				this.sizers[i].style.opacity = 0.0 ;				
-			}	        
+	        /* Altered:*/ 
 	        this.sizers[i].style.height="1px" ;
 	        /* Altered. */
 	        this.sizers[i].className = this.isHorizontal ? 'dojoSplitContainerSizerH' : 'dojoSplitContainerSizerV';
@@ -2009,8 +2014,7 @@
 		if (!this._indentSpan){
 			this._indentSpan = document.createElement("span");
 			this._indentSpan.style.overflow= "hidden" ;
-			this._indentSpan.style.whitespace= "nowrap" ;			
-			td.appendChild(this._indentSpan);
+			this._indentSpan.style.whitespace= "nowrap" ;			td.appendChild(this._indentSpan);
 			this._indentSpan.innerHTML = "&nbsp;";
 			dojo.event.connect(this._indentSpan, "onclick", this, "onExpandCallback");
 			this._adjustImage();
@@ -2222,8 +2226,3 @@
     prompt("",s);
 
 }
-
-
-
-
-