Changeset 262 for trunk


Ignore:
Timestamp:
07/17/05 00:46:20 (14 years ago)
Author:
gogo
Message:

Fix context menu when the main document is in CSS1Compat mode in
IE - ticket:166

The problem was that the popup in IE is actually a separate document,
which is in BackCompat? mode, and when we tried to size the popup we
insert the content into the CSS1Compat document to get the size then
display it in the BackCompat? document, where things are decidedly
different.

Location:
trunk/plugins/ContextMenu
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/ContextMenu/context-menu.js

    r203 r262  
    427427                div.style.top = y + "px"; 
    428428        } else { 
    429                 // determine the size (did I mention that IE stinks?) 
    430                 var foobar = document.createElement("div"); 
    431                 foobar.className = "htmlarea-context-menu"; 
    432                 foobar.innerHTML = div.innerHTML; 
    433                 document.body.appendChild(foobar); 
    434                 var w = foobar.offsetWidth; 
    435                 var h = foobar.offsetHeight; 
    436                 document.body.removeChild(foobar); 
     429    // To get the size we need to display the popup with some width/height 
     430    // then we can get the actual size of the div and redisplay the popup at the 
     431    // correct dimensions. 
     432    this.iePopup.show(ev.screenX, ev.screenY, 300,50); 
     433                var w = div.offsetWidth; 
     434                var h = div.offsetHeight; 
    437435                this.iePopup.show(ev.screenX, ev.screenY, w, h); 
    438436        } 
  • trunk/plugins/ContextMenu/menu.css

    r23 r262  
    2626div.htmlarea-context-menu tr.item td.icon { 
    2727  padding: 0px 3px; 
     28  width: 18px; 
    2829  height: 18px; 
    2930  background-color: #cdf; 
Note: See TracChangeset for help on using the changeset viewer.