Bind a click handler to collapse the toolbar menulist when click event occurs

This commit is contained in:
Hadi Nategh 2014-03-04 11:03:03 +00:00
parent 2160ccc029
commit 1e449f571a

View File

@ -319,7 +319,20 @@ var et2_toolbar = et2_DOMWidget.extend(
toolbox.accordion({
heightStyle:"fill",
collapsible: true,
active:'none'
active:'none',
activate: function (event, ui) {
var menubox = event.target;
if (ui.oldHeader.length == 0)
{
$j('html').on('click.outsideOfMenu', function (event){
$j(menubox).accordion( "option", "active", 2);
$j(this).unbind(event);
});
}
},
create: function (event, ui) {
$j('html').unbind('click.outsideOfMenu');
}
});
},