Opened 14 years ago

Closed 12 years ago

#315 closed defect (worksforme)

Context menu doesn't display correctly in IE

Reported by: white@… Owned by: gogo
Priority: normal Milestone:
Component: Plugin_ContextMenu Version: trunk
Severity: normal Keywords: context menu
Cc:

Description

When I right click to get a context menu in IE, the context menu pops up, but it is much bigger than it is supposed to be. The menu items still render in the top left of the too-big popup. Sometimes the context menu is so big it flows off the top and bottom of my screen.

Change History (6)

comment:1 Changed 14 years ago by vdavid@…

My Javascript experience is not up to scratch, but I've pinpointed where the problem is.

it's to do with these two variables located in context-menu.js line number:434 and 435

var w = foobar.offsetWidth;
var h = foobar.offsetHeight;

as a quick workaround, so that you can use the context menu you might want to set the h and w vars manually to something like

var w = 200;
var h = 520;

You still see the white space from the oversized dimensions... but eh, at least you can work still use the context menu. *shrugs*

ps I agree with the authoer "IE IS F*CKING SH*T!" and "IE STINKS" hehe

comment:2 Changed 14 years ago by vdavid@…

another note: the reason that it's so tall and wide is because IE gets the offset height and offset width of the actual HTML code which is about 101 lines
and not the browser parsed output.

ps sorry if I am stating the obvious.

comment:3 Changed 14 years ago by vdavid@…

QUIRKS MODE!!! ARRRRGGGGHHH!!

A quick workaround that does the trick would be to put the page into quirks mode - remove the dtd url from your DOCTYPE tag.

change this:

<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01 TransitionalEN"

"http://www.w3.org/TR/html4/transitional.dtd">

to this:

<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01 TransitionalEN">
pretty crap eh?
but yeah this is how you could fix it.

comment:4 Changed 14 years ago by trem

Just wanted to add to this ticket. We have been doing some testing and have had similar problems though in our case the menu is too short (misses half of the last item off the menu). Seems to be OS related though.

XP with IE6 has the problem, though IE6 on NT is ok. Again a temporary solution for us is to add a little more onto the

var h = foobar.offsetHeight

comment:5 Changed 14 years ago by charles@…

So, patching this would be as easy as changing line 31x in context-menu.js from

doc.write("<html><head><style type='text/css'>@import url(" + _editor_url + "plugins/ContextMenu/menu.css); html, body { padding: 0px; margin: 0px; overflow: hidden; border: 0px; }</style></head><body unselectable='yes'></body></html>");

to

doc.write("<!DOCTYPE HTML PUBLIC \"-W3CDTD HTML 4.01 TransitionalEN\"><html><head><style type='text/css'>@import url(" + _editor_url + "plugins/ContextMenu/menu.css); html, body { padding: 0px; margin: 0px; overflow: hidden; border: 0px; }</style></head><body unselectable='yes'></body></html>");

Or at least, it seems to work for me here

comment:6 Changed 12 years ago by ray

  • Resolution set to worksforme
  • Status changed from new to closed

works for me

Note: See TracTickets for help on using tickets.