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

delegate events #16

Closed
guzmanpaniagua opened this issue Aug 13, 2014 · 1 comment
Closed

delegate events #16

guzmanpaniagua opened this issue Aug 13, 2014 · 1 comment

Comments

@guzmanpaniagua
Copy link

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

@M21B8
Copy link

M21B8 commented Jul 21, 2015

I have exactly the same problem :(

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

3 participants