Giter Site home page Giter Site logo

metismenu's Issues

Highlight active leaf item

I'd like to highlight the current "clicked" (active) link at the leaf level, how can I do that?

Currently, the "active" css class is added only to the items which are menu or sub-menu, but I'd like to
add an active status to the "ul ul ul a"

I added this css code:

.sidebar-nav ul ul ul a:hover,
.sidebar-nav ul ul ul a:focus,
.sidebar-nav ul ul ul a:active {
background-color: rgba(0, 0, 255, 0.15);
background-color: rgba(0, 0, 255, 0.15);
}

the leaf are highlighted on mouse over, but when the link is clicked the doesn't remain highlighted!

toggle doesn't work when no sub-menu is present

Hi, I found out that toggle doesn't work right with items that don't have sub-menus.

For example:

<ul id="menu">
    <li><a href="#/page1">Page 1</a>
        <ul>
            <li><a href="#/sub-page1">Sub-page </a></li>
            <li><a href="#/sub-page2">Sub-page 2</a></li>
        </ul>
    </li>
    <li><a href="#/page2">Page 2</a></li>
</ul>

The problem is line 37 in the code:

$this.find("li").has("ul").children("a").on("click" + "." + pluginName, function(e) ...

Everything works fine when I remove .has("ul") from the code.

The thing is I'm working with angular and not using direct links but routing based on my location, so even when the link doesn't have a sub-menu, it still doesn't go to a new page but should toggle the other menus.

Cheers,
Jan Fucik

Dependency on bootstrap

Why did you add dependency on bootstrap in version 1.1.2?

The problem is there are 2 version of bootstrap: bootstrap and bootstrap-sass. And now it's hard to use metisMenu with the second one because it require to install unnecessary bootstrap.

Can we do anything with this?

Thank you for your work on metisMenu ❤️!

Multi-level keep menu open

Hello,

With the current version only the first sub-level (

    ) keeps open when the page reload.

    I need the menu to keep the same behavior for the next sub-level (

      ). The class is set to active for the .

      Is this possible by modifying the js ?

focus on and open toggle menu

Hello,

I want to focus on and open toggle menu item.
I mean for example if I click on first level nav I want to show a page and to open the accordion menu to see the second level nav. Right now it's only possible to open the accordion menu.
Is that possible?

delegate events

hi,

I am trying to use the menu with angular, and the html does not exist when the plugin is called in de document ready.

when you apply the events you use:
$this.find("li").has("ul").children("a").on("click", function(e) {

this requires the html markup exist, and creates one event for every link, i have change in my local version for some thing like
$this.on( "click", "a", function( e ) {

this change creates only one event.

i don´t know if this change is usefull.

p.d. if you want to try witdh angular this is my aproach

the html
<li class="active" ng-repeat='item in items'>
<a href="#"><i class="fa {{item.icon}} fa-fw"></i> {{item.title}}<span class="{{item.arrow}}"></span></a>
<ul class="nav nav-second-level">
<li class="active" ng-repeat='itemLv2 in item.childsLv2'>
<a href="#"><i class="fa {{itemLv2.icon}} fa-fw"></i>{{itemLv2.title}}<span class="{{item.arrow}}"></span></a>
<ul class="nav nav-third-level">
<li ng-repeat='itemLv3 in itemLv2.childsLv3'>
<a href="#"><i class="fa {{itemLv3.icon}} fa-fw"></i> {{itemLv3.title}}</a>
</li>
</ul>
<!-- /.nav-third-level -->
</li>
</ul>
<!-- /.nav-second-level -->
</li>

the js
var app = angular.module('consolas', [ 'ngRoute' ]);
function SideBarController($scope) {
$scope.items = [ {
title : 'JASOP Bundlor',
page : 'index',
icon : 'fa-sitemap',
arrow: 'fa arrow',
childsLv2 : [ {
title : 'Transaction Processing',
page : 'transactionLogic',
icon : 'fa-dashboard',
arrow: 'fa arrow',
childsLv3 : [ {
title : 'Transaction logic',
page : 'transactionLogic',
icon : 'fa-table'
}, {
title : 'Transaction config',
page : 'transactionConfig',
icon : 'fa-table'
} ]
}, {
title : 'Online Applications',
page : 'onlineApplications',
icon : 'fa-dashboard'
} ]
}, {
title : ' JASOP Online',
page : 'index',
icon : 'fa-sitemap',
arrow: 'fa arrow',
childsLv2 : [ {
title : 'OSGI',
page : 'bundles',
icon : 'fa-dashboard',
arrow: 'fa arrow',
childsLv3 : [ {
title : 'Bundles',
page : 'bundles',
icon : 'fa-table'
}, {
title : 'Configuration',
page : 'configuration',
icon : 'fa-wrench'
}, {
title : 'Log service',
page : 'logService',
icon : 'fa-edit'
}, {
title : 'Services',
page : 'services',
icon : 'fa-table'
} ]
}, {
title : 'Memory Usage',
page : 'memoryUsage',
icon : 'fa-bar-chart-o'
}, {
title : 'System information',
page : 'systemInformation',
icon : 'fa-edit'
}, {
title : 'Licenses',
page : 'licenses',
icon : 'fa-files-o'
}
]
}
];
}

thanks

URL recognition isn't quite magic enough

I'm trying to use metisMenu on our admin area. When I go to the URL /admin/reports/monthly_sales/, all three listed below are highlighted in the menu. As the admin area is namespaced, all the URLs start with /admin/, therefore visiting any URL will highlight the root admin link.

/admin/reports/monthly_sales
/admin/reports
/admin

I don't know if it's related, but any option at the third level is collapsed, rather than remaining expanded as it should.

Minimum jquery version for using metis menu.

Will the metis menu work with jquery 1..3.1.Earlier i was using version 2.1.1 and it was working properly.I have to use version 1.3.1 because my organization has strict restriction to use this version.Please help me with this scenario.

Improvement: Active class for child item

Hi,

I think an active class should be added for menu item selected (child item).
This is also confusing because in your code the active class is for open state instead of active (selected).
bug #33
I was looking for that because I want to add the active class to the selected sub-item.

Parent 1
------ Child A
-------Child B (selected/clicked)
-------Child C

Suggestion to make the .arrow class name more specific

I'm trying to implement the intl-tel-input plugin and there is a conflict with metisMenu regarding the .arrow class.

The issue is that while intl-tel-input specifies the selector as specific:
.intl-tel-input .selected-flag .arrow {

metisMenu has a broad selector that captures everything, including other elements:
.arrow {

This results in some important styles being overwritten and forces me to reset the defaults on my app's CSS.

Is it possible to refactor the stylesheet for metisMenu to be more specific as to isolate the effect it has on other controls in the same application?

metisMenu.d.ts

Haven't looked into how hard it would be, might be nice to make a Typescript d.ts file for this.

Disable

How to disable a item of list? Disabling means preventing to expand the item. Adding the .disabled of bootstrap causes the visual effect but still can be expanded.

Animations duplicate on Safari browser

metisMenu works great on every browser I have tested it on, except for Safari. I have tested on both OS X Mavericks and Yosemite with the same outcome.

When clicking on a menu category, the expanding animation occurs twice in a row. After the first animation, it resets and does it a second time.

More levels

Is there a way that I can add more levels to the menu,. I see only

Root

  • level 1
    -- level 2
    --- level 3
    ---- level 4 (how can i do this?)

I would like to add a level 4

Thanks again for amazing work

Demo code pulls old version from CDN

The index.html demo pulls:

"//cdn.jsdelivr.net/bootstrap.metismenu/1.1.0/js/metismenu.min.js"

i.e. not the latest version of metismenu.min.js.

Steve

ie8/9 issue

Collapse issue, same like #7 but its not working

if you open it on Internet Explorer you have to open -> close -> open to view the child menu.

Even the repo demo is not working on IE

Suggestion for changing the .active class name

Just a suggestion: maybe the .active class name should be changed to .open: IMHO, the .active class name should be used only for the list item bound to current page opened
Anyway, metisMenu is a GREAT job: thank you!

Tag for version 1.1.0

Versión 1.1.0 don't have tag. This is a little problem for bower users, that want use it.

Plugin not work

Hi,
This plugin is great, but not work at all.
Not work your demos: if i extract all zip folder and lunch /test/ files like hover.html, metisFolder.html and others. All CSS is broken and no js functionality.
2015-05-24_145213

If i try to use in my website (with bootstrap 100% included and work good). same results...

Why this happen? in true seem a your error in create download package.
Thanks

Bootstrap in depedency

I'm using it with inventive ui so I don't need bootstrap in bower components though it still download that.

Its possible to use your product without bootstrap so you can include general version and bootstrap version.

There should not be dependency in package itself when it can easily be replaced with generic.

This way you can reach all audiences not specific ones.

Bower.json: main

I think the 'main' property in bower.json should have a value of "dist/metisMenu.js" rather than "metisMenu.js". As it is currently, build tools will not find any metisMenu.js in the root directory...

Open level of active only?

Is it possible to leave the selected menu open after click? It is possible to change the script on the end page to leave the selected menu open after click?

Closed menu (at start)

Country 1
Country 2
Country 3


Opened menu after click on Country 2

Country 1
Country 2
--Region 1 > Click on this item
--Region 2
--Region 3
Country 3


Country 1
Country 2 This level should be opened
--Region 1 > This item should be active
--Region 2
--Region 3
Country 3

expand

Hi,

When the menu is open and one of the sub menu has a href set to another page. Is it possible to once navigated to keep this menu open. I tried with jquery cookie but it is not working properly see below code :

        var menuCookie = $.cookie('cookie_collapse');
        $(".nav-second-level li a").click(function (e) {
            menuCookie = $.cookie('cookie_collapse', $(e.target).attr('id'));
            console.log(menuCookie);
            e.stopPropagation();
        });

        console.log(menuCookie);
        if (menuCookie) {
            $('#' + menuCookie).parent().parent().parent().addClass('active');
        }

Menu items are not clickable?

Hello Onokumus

I was wondering if you could help me with a code change please?
I recently implemented your metismenu here: http://bit.ly/1hus0IV
The items on the menu that are marked in blue e.g. "Adult Costumes" or "Childrens Costumes"
I need them to be clickable. They are meant to go to a page on the website.

At the moment the link is somehow turned off.

How do I change this?

Thanks very much.

Cheers

while doesn't loop

I found this structure twice in the code. Looks like a flow control issue

  while (
            div.innerHTML = "<!--[if gt IE " + (++v) + "]><i></i><![endif]-->",
            all[0]
        ) {
            return v > 4 ? v : undef;
        }

2nd click goto page

How to do when user clicks on second time on the parent it should navigate to page directly?

IE8 Collapse Issue

I was having an issue with this plugin working in IE8. Clicking a menu item once would do nothing but the second time would toggle the collapse. I corrected the issue by modifying the Plugin.prototype function to the below.

$this.find('li.active').has('ul').children('ul').collapse('show');
$this.find('li').not('.active').has('ul').children('ul').collapse('hide');

Adding items to menu

I am building a backbone client app that adds one or more

  • items after fetching data from an API asynchronously. It does not seem to be possible to make metis menu work for
  • items that are added at a later stage. I can call $('#side-menu').metisMenu() a second time but it won't pick up the new items.

  • Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.