![]() |
[JavaScript] PopupMenu misplaced - Printable Version +- MyBB Community Forums (https://community.mybb.com) +-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html) +--- Forum: General Support (https://community.mybb.com/forum-176.html) +--- Thread: [JavaScript] PopupMenu misplaced (/thread-160142.html) |
PopupMenu misplaced - moserw - 2014-09-25 I upgraded my forum from 1.6 to 1.8 and adjusted my templates appropriately. Everything seems to be working fine except for the popup menu. The popup menu of the edit post button is completely displaced while the popup menu for the Thread Modes is placed correctly. See screenshots. My forum is wrapped within a centered div element with position attribute set to relative. In addition I am using a top spacer div element where the position is also set to relative. <div id="submenuTopSpacer"></div> <div id="mainWrapper"> ... #submenuTopSpacer { background: none repeat scroll 0 0 #bfd5de; height: 50px; position: relative; width: 100%; } #mainWrapper { background-color: #ffffff; margin: 0 auto; position: relative; width: 960px; z-index: auto; } I think that the problem is that the java script code in jquery.plugins.min.js does not set the position properly if the forum is placed within position:relative elements. I fixed the problem by adding the following lines to the script: // Setup popup menu var offset = el.offset(); // WoM fix edit popup menu start var el_parent = el.get(0).parentNode; var popup_parent = popup_menu.get(0).parentNode; if (el_parent === popup_parent) { offset = el.position(); } // WoM fix edit popup menu end offset.top += el.outerHeight(); The changed script simply uses the position() command instead of the offset() command if the popup element and the button have the same parent node. The addition to the script fixes my problem. Maybe you may consider to add the changes to the next version or hava another advice to fix the problem without changing the js files. Here is the link to my forums: http://murlengine.com/forum/?murlpage=forum Thanks! RE: PopupMenu misplaced - blackdragon - 2014-10-31 So I'm having the same issue but instead of the Thread Modes popup menu it's the popup menus from the Edit, Delete, Reply and so on buttons below the post. They are way off. Tried using this "fix" but didn't work. Could really use some help on this as our forum is supposed to be going live next week. Thanks RE: PopupMenu misplaced - moserw - 2014-10-31 (2014-10-31, 02:06 PM)blackdragon Wrote: So I'm having the same issue but instead of the Thread Modes popup menu it's the popup menus from the Edit, Delete, Reply and so on buttons below the post. They are way off. Tried using this "fix" but didn't work. Could really use some help on this as our forum is supposed to be going live next week. My problem was also the Edit popup menu. The Thread Modes popup worked just fine. Try the fix above, it should work. If it really does not work you will have to debug your site with e.g. Firebug. Good luck! RE: PopupMenu misplaced - blackdragon - 2014-10-31 (2014-10-31, 02:23 PM)moserw Wrote:(2014-10-31, 02:06 PM)blackdragon Wrote: So I'm having the same issue but instead of the Thread Modes popup menu it's the popup menus from the Edit, Delete, Reply and so on buttons below the post. They are way off. Tried using this "fix" but didn't work. Could really use some help on this as our forum is supposed to be going live next week. Tried it, still not working :-( RE: PopupMenu misplaced - moserw - 2014-11-01 (2014-10-31, 02:31 PM)blackdragon Wrote: Tried it, still not working :-( Then you will have to debug your site and try to figure out why the position values are wront. The script mentioned in my post is evaluating and setting the position values for the popup menu. I would recommend to install firebug, set a breakpoint and debug step by step. Good luck. RE: PopupMenu misplaced - Leefish - 2015-02-08 This fixed this hugely annoying issue for me perfectly, and no negative effect on the default theme either (ie it still works). Thank you very much. RE: PopupMenu misplaced - Brentsticles - 2015-09-09 I need an explanation on how to implement this fix please if someone would be kind enough as I am having the same issue. My thread about my problem: http://community.mybb.com/thread-178100.html RE: PopupMenu misplaced - moserw - 2015-11-13 (2015-09-09, 11:44 AM)Brentsticles Wrote: I need an explanation on how to implement this fix please if someone would be kind enough as I am having the same issue.
|