Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

MeModule help

I'm a new Vanilla user, and I was just trying to customise it.

I like the idea of the 4 buttons and I'd like to keep that, maybe I'll stick it right up the top like on facebook. It is referred to in my template as 'MeModule', though I cannot find anything called MeModule in the plugins.

I have one huge problem with this MeModule thing, and that is clicking elsewhere on the page doesn't close the menu. I can't... why is it like that..!

If there is a commonly known solution for this I would love to know, otherwise perhaps help me devise a sensible strategy for overriding this behaviour? I am a javascript and php developer, but I know messing around with core files can be a problem in these kinds of systems when it comes to upgrades.

If it was an actual module I figure I could disable it, and make a copy of it and enable the copy instead (which I would modify).

Comments

  • hey.... on this site it closes when I click elsewhere! Can anyone shed some light on why I am experiencing something different?

  • Also the popup menu goes to the right, how can I make it go to the left? I want the buttons over the right side.

  • nevermind about the left side thing, that was an easy css override

  • hgtonighthgtonight ∞ · New Moderator

    Welcome to the community!

    It should close the menu when clicking anywhere outside the menu. Are you having this same issue with the cog wheel for discussions/comments?

    I would check your console for errors. I am guessing you are running a plugin that is preventing clicks from propagating up the DOM tree.

    You can override any module pretty easily with a plugin, theme, or themehook. I don't think that is the proper solution here, but I might be wrong.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Sorry I just noticed I have Version 2.1.3, which means I posted this in the wrong place.

    There are no console errors, and I haven't installed any plugins.
    Yes it happens with the other cog wheel.

    It seems this is a theme specific problem. My theme is based on default, but uses a tpl file based on the one from Bootstrap. Bootstrap also has the problem.

    No idea what the issue is.

  • hgtonighthgtonight ∞ · New Moderator

    Bootstrap looks for different markup, IIRC. Doesn't it use a modal interface for popup menus?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Yeah OK I figured it out.

    The 'Flyout' is controlled in /js/global.js which contains the following line around line 809

    $(document).delegate('#Body', 'click', function() {

    This means to close the Flyout with a stray click, it depends on everything being wrapped in a div with id Body. Very strange design choice there I must say.

    I'll just wrap my whole page in a #Body div, but I don't like it :P

  • @thermite said:
    This means to close the Flyout with a stray click, it depends on everything being wrapped in a div with id Body. Very strange design choice there I must say.

    This is because Flyouts can be added dynamically (for example, when you edit a post).

    You need to delegate the click event to an element you know is always there, because the handler doesn't get attached to Flyout links that don't exist on document.ready.

    Don't reuse the #Body ID. I'd try to change the MeModules position purely with CSS like the theme on this site does it, for example.

  • I know how it works, normally you would use the body tag. Ideally the js would be rewritten to not rely on specific ids, not a huge deal I guess.
    I think you have misunderstood what I'm doing. There is no existing #Body tag in my tpl file (taken from Bootstrap theme), that's why I need to put one in.

    ps. why still use delegate? it was superseded 3 years ago.

  • It's most likely for performance reasons, but I agree, attaching it to the document root would make it more flexible.
    You could create a pull request :)

    delegate() is still used because Vanilla 2.0 was on jQuery 1.6.2

Sign In or Register to comment.