Changes to Rico 3 as a result of regression testing with IE6, IE7, and IE8.
[infodrom/rico3] / minsrc / ricoUI.js
index 2edd0f4..e5e47b7 100644 (file)
@@ -99,42 +99,34 @@ Rico.Popup.prototype = {
     } else {
       this.position=this.container.style.position=this.options.position;
     }
-    if (this.position != 'absolute') {
-      this.content=this.container;
-      return;
+    this.content=document.createElement('div');
+    while (this.container.firstChild) {
+      this.content.appendChild(this.container.firstChild);
     }
-    if (this.options.zIndex >= 0) this.container.style.zIndex=this.options.zIndex;
+    this.container.appendChild(this.content);
+    this.content.className='RicoPopupContent';
+    this.content.style.position='relative';
+    if (this.position != 'absolute') return;
+
     if (this.options.closeFunc) {
       this.closeFunc=this.options.closeFunc;
     } else {
       var self=this;
       this.closeFunc=function() { self.closePopup(); };
     }
-    //this.container.style.overflow='hidden';
     this.container.style.top='0px';
     this.container.style.left='0px';
     this.container.style.display='none';
-
-    this.content=document.createElement('div');
-    while (this.container.firstChild) {
-      this.content.appendChild(this.container.firstChild);
-    }
-    this.container.appendChild(this.content);
-    this.content.className='RicoPopupContent';
-    this.content.style.position='relative';
+    if (this.options.zIndex >= 0) this.container.style.zIndex=this.options.zIndex;
+    this.content.style.zIndex=2;
 
     if (Rico.isIE && Rico.ieVersion < 7) {
       // create iframe shim
       this.ifr = document.createElement('iframe');
-      this.ifr.style.position="absolute";
-      this.ifr.style.top     = '0px';
-      this.ifr.style.left    = '0px';
-      this.ifr.style.width   = '2000px';
-      this.ifr.style.height  = '2000px';
-      this.ifr.style.zIndex  = -1;
-      this.ifr.frameBorder   = 0;
-      this.ifr.src="javascript:false;";
-      this.content.appendChild(this.ifr);
+      this.ifr.className='RicoShim';
+      this.ifr.frameBorder=0;
+      this.ifr.src="javascript:'';";
+      this.container.appendChild(this.ifr);
     }
     Rico.applyShadow(this.container,this.options.shadow);
 
@@ -228,13 +220,13 @@ Rico.Popup.prototype = {
  * Display popup at specified position
  */
   openPopup: function(left,top) {
-    this.container.style.display=this.position=='absolute' ? "block" : Rico.isIE && Rico.ieVersion<8 ? "inline" : "inline-block";
     if (typeof left=='number') this.container.style.left=left+'px';
     if (typeof top=='number') this.container.style.top=top+'px';
+    this.container.style.display=''; //this.position=='absolute' ? "block" : Rico.isIE && Rico.ieVersion<8 ? "inline" : "inline-block";
     if (this.container.id) Rico.log('openPopup '+this.container.id+' at '+left+','+top);
     Rico._AddOpenPopup(this);
   },
-
+  
   centerPopup: function() {
     this.openPopup();
     var msgWidth=this.container.offsetWidth;
@@ -340,12 +332,13 @@ Rico.Window.prototype = {
     if (options.overflow) this.contentDiv.style.overflow=options.overflow;
     Rico.addClass(this.content,'ricoWindow');
     if (Rico.theme.dialog) Rico.addClass(this.content,Rico.theme.dialog);
+    /*
     if (Rico.isIE) {
       // fix float'ed content in IE
       this.titleDiv.style.zoom=1;
       this.contentDiv.style.zoom=1;
     }
-
+    */
     this.content=this.contentDiv;
   },
 
@@ -457,7 +450,7 @@ Rico.Menu.prototype = {
     arrowdiv.style[dir]='0px';
     a.RicoSubmenu=submenu;
     Rico.eventBind(a,"mouseover", Rico.eventHandle(this,'showSubMenu'));
-    Rico.eventBind(a,"mouseout", Rico.eventHandle(this,'subMenuOut'));
+    //Rico.eventBind(a,"mouseout", Rico.eventHandle(this,'subMenuOut'));
   },
 
   showSubMenu: function(e) {
@@ -474,6 +467,7 @@ Rico.Menu.prototype = {
     a.RicoSubmenu.openmenu(parseInt(this.container.style.left)+a.offsetWidth, parseInt(this.container.style.top)+a.offsetTop, a.offsetWidth-2, a.offsetHeight+2,true);
   },
 
+  /*
   subMenuOut: function(e) {
     if (!this.openSubMenu) return;
     Rico.eventStop(e);
@@ -486,6 +480,7 @@ Rico.Menu.prototype = {
     if (reltg == this.openSubMenu.div) return;
     this.hideSubMenu();
   },
+  */
 
   hideSubMenu: function() {
     if (this.openMenuAnchor) {
@@ -542,6 +537,7 @@ Rico.Menu.prototype = {
       this.highlightElem=null;
     }
     var elem=Rico.eventElement(e);
+    if (elem.parentNode == this.openMenuAnchor) elem=elem.parentNode;
     if (this.openMenuAnchor && this.openMenuAnchor!=elem)
       this.hideSubMenu();
     if (elem.className=='enabled') {