<script src="../../ui/jquery.ui.menubar.js"></script>
<script>
$(function() {
+ function select(event, ui) {
+ $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
+ if (ui.item.text() == 'Quit') {
+ $(this).menubar('destroy');
+ }
+ }
$("#bar1").menubar({
position: {
within: $("#demo-frame").add(window).first()
},
- select: function(event, ui) {
- $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
- }
+ select: select
});
$(".menubar-icons").menubar({
position: {
within: $("#demo-frame").add(window).first()
},
- select: function(event, ui) {
- $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
- }
+ select: select
});
});
</script>
},
select: function( event, ui ) {
ui.item.parents( "ul.ui-menu:last" ).hide();
- that._trigger( "select", event, ui );
that._close();
// TODO what is this targetting? there's probably a better way to access it
$(event.target).prev().focus();
+ that._trigger( "select", event, ui );
}
})
.hide()
if( that.options.autoExpand ) {
clearTimeout( that.timer );
}
-
+
that._open( event, menu );
}
})
.attr( "role", "menuitem" )
.attr( "aria-haspopup", "true" )
.wrapInner( "<span class='ui-button-text'></span>" );
-
+
if ( that.options.autoExpand ) {
input.bind( "mouseleave.menubar", function( event ) {
that.timer = setTimeout( function() {