Thread: Integration with vBulletin - Dynamic Joomla!VB wrapper
View Single Post
  #47  
Old 06-12-2008, 06:13 AM
illPhever illPhever is offline
 
Join Date: Mar 2004
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cheesegrits View Post
3) There's a bug with vb's dropdown menus. As I click on them, they got displayed away from menu (see pic).

This is a semi-well known quirk of vB's menu control javascript. It assumes there are no blocks on the page between the menu location and the document root which use 'position=absolute' or 'position=relative'. In other words, vB always assumes it is calculating coordinates relative to the top left of the document. But if the menu is within any block which uses positioning (like your J! template), it is then rendered with the coordinates being relative to that block. So the menu is shifted down and to the right.

The only cure I've found for this is a vB file edit, which I hate doing, but I've yet to find a workaround for it. In ./clientscript/vbulletin_menu.js, edit the following function to look like this:

Code:
vB_Popup_Menu.prototype.fetch_offset = function(obj)
{
    /*
    if (obj.getBoundingClientRect)
    {
        // better, more accurate function for IE
        var rect = obj.getBoundingClientRect();

        var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
        var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);

        if (document.documentElement.dir == 'rtl')
        {
            // IE returns a positive scrollLeft, but we need a negative value to actually do proper calculations.
            // This actually flips the scolloing to be relative to the distance scrolled from the default.
            scrollLeft = scrollLeft + document.documentElement.clientWidth - document.documentElement.scrollWidth;
        }

        return { 'left' : rect.left + scrollLeft, 'top' : rect.top + scrollTop };
    }
    */

    var left_offset = obj.offsetLeft;
    var top_offset = obj.offsetTop;

    while (YAHOO.util.Dom.getStyle(obj, 'position') == 'static' && (obj = obj.offsetParent) != null)
    {
        left_offset += obj.offsetLeft;
        top_offset += obj.offsetTop;
    }

    return { 'left' : left_offset, 'top' : top_offset };
};
As always with code edits, make sure you keep an original copy of the file in case you moof it up.

-- hugh
those changes didn't seem to work for me. after making the change, the dropdown menu fails to appear at all, and it logs an error, "Error: 'YAHOO' is undefined"

i noticed that on shadowraith's site (http://crimsonshadows.net/forum), he has the same problem with the dropdowns, too.

any other suggestions would be greatly appreciated.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01154 seconds
  • Memory Usage 1,770KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete