aboutsummaryrefslogtreecommitdiffstats
path: root/demos/menubar/default.html
diff options
context:
space:
mode:
Diffstat (limited to 'demos/menubar/default.html')
-rw-r--r--demos/menubar/default.html14
1 files changed, 8 insertions, 6 deletions
diff --git a/demos/menubar/default.html b/demos/menubar/default.html
index 6bd67b64a..adee4afc9 100644
--- a/demos/menubar/default.html
+++ b/demos/menubar/default.html
@@ -13,13 +13,17 @@
<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({
@@ -29,9 +33,7 @@
position: {
within: $("#demo-frame").add(window).first()
},
- select: function(event, ui) {
- $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log");
- }
+ select: select
});
});
</script>