Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger element dissappears #15

Closed
ghost opened this issue Jan 2, 2015 · 4 comments
Closed

Trigger element dissappears #15

ghost opened this issue Jan 2, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 2, 2015

When I click the menu trigger a second time (once it's expanded, in order to close it) it gets hidden.

I can't see why this is happening, could you perhaps see where I've gone wrong?

The markup is:

<ul id="l10n-menu">
    <li>
        <a href="#" class="current-locale en_GB">
            v
        </a>
        <ul>
            <li>
                <a href="?locale=en_US" class="en">English (US)</a>
            </li>
            <li>
                <a href="?locale=ur" class="ur" dir="rtl">Urdu</a>
            </li>
        </ul>
    </li>
</ul>

And my init code is:

$(document).ready(function () {
    $('#l10n-menu').dropit();
});
@ghost
Copy link
Author

ghost commented Jan 2, 2015

Oh, and if I click anywhere else to drop focus, it works normally, only when I click the trigger element.

@mattgiltaji
Copy link

changing this

$(this).parents(settings.triggerParentEl).removeClass('dropit-open').find(settings.submenuEl).hide();

to this

$('.dropit-open').removeClass('dropit-open').find('.dropit-submenu').hide();

seems to fix it for me.

@artefactio
Copy link

I had the same issue too. It seems to happen when Dropit is nested inside another list. Thumbs up @mattgiltaji your fix worked for me.

@ghost
Copy link
Author

ghost commented Apr 23, 2015

Fantastic, that looks like it will sort it. I've tried it in a sandbox and it works, I will have to try it in the original project later, but I'm sure this will have fixed it.

Cheers!

@ghost ghost closed this as completed Apr 23, 2015
daveobriencouk added a commit to daveobriencouk/Dropit that referenced this issue Sep 24, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants