Skip to content
This repository has been archived by the owner on Mar 12, 2018. It is now read-only.

Commit

Permalink
Adjust submenu mouse behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
ofShard committed Nov 15, 2013
1 parent 640a818 commit 2d0b52b
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/documents/scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,28 @@ YUI().use('node', 'event', 'event-valuechange', function(Y) {
Y.all('.sharethis').toggleClass('block');
});

var navLast;
// Left sidebar dropdown menus
var navEnter = function(e){
e.currentTarget.one('.nav').setStyle('display','block');
if (!e.currentTarget.one('.nav') || navLast === e.currentTarget) return;

console.log('enter', e.currentTarget);

e.currentTarget.one('.nav').setStyle('display', 'block');

if (navLast)
navLast.one('.nav').setStyle('display', 'none');

navLast = e.currentTarget
};
var navLeave = function (e){
e.currentTarget.one('.nav').setStyle('display','none');
};
Y.one('.nav').delegate('mouseenter', navEnter, 'li' );
Y.one('.nav').delegate('mouseleave', navLeave, 'li' );
var navSidebarLi = Y.all('nav.sidebar-menu > ul > li');
navSidebarLi.on('mouseenter', navEnter);

var navSubHeight = 109;
Y.all('nav.sidebar-menu li .nav').each(function(el) {

el.setStyle('height', navMaxHeight);
});

// Mobile menu
Y.one('select').on('change', function(){
Expand Down

0 comments on commit 2d0b52b

Please sign in to comment.