aboutsummaryrefslogtreecommitdiffstats
path: root/demos/menu/contextmenu.html
diff options
context:
space:
mode:
authorgnarf <gnarf@gnarf.net>2011-05-10 16:16:34 -0500
committergnarf <gnarf@gnarf.net>2011-05-10 16:16:34 -0500
commit27a7deebf299e1673e8b452476be02e486bba2c6 (patch)
tree79521a78ab770ebd7ee167575b680f14d3ed4089 /demos/menu/contextmenu.html
parent4dcfeee8d54d81db4d5af8b2fd189b799cd9561e (diff)
parent85ac420a1e4281ee7f361e847d3cad72fa58525e (diff)
downloadjquery-ui-27a7deebf299e1673e8b452476be02e486bba2c6.tar.gz
jquery-ui-27a7deebf299e1673e8b452476be02e486bba2c6.zip
Merge branch 'master' into effects-unit
Conflicts: ui/jquery.effects.pulsate.js
Diffstat (limited to 'demos/menu/contextmenu.html')
-rw-r--r--demos/menu/contextmenu.html48
1 files changed, 16 insertions, 32 deletions
diff --git a/demos/menu/contextmenu.html b/demos/menu/contextmenu.html
index 0fb98c140..115f15b24 100644
--- a/demos/menu/contextmenu.html
+++ b/demos/menu/contextmenu.html
@@ -3,44 +3,28 @@
<head>
<meta charset="UTF-8" />
<title>jQuery UI Menu - Contextmenu demo</title>
- <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
- <script type="text/javascript" src="../../jquery-1.5.1.js"></script>
- <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
- <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
- <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
- <script type="text/javascript" src="../../ui/jquery.ui.menu.js"></script>
- <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
- <link type="text/css" href="../demos.css" rel="stylesheet" />
- <script type="text/javascript">
+ <link href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
+ <script src="../../jquery-1.5.1.js"></script>
+ <script src="../../ui/jquery.ui.core.js"></script>
+ <script src="../../ui/jquery.ui.position.js"></script>
+ <script src="../../ui/jquery.ui.widget.js"></script>
+ <script src="../../ui/jquery.ui.menu.js"></script>
+ <script src="../../ui/jquery.ui.button.js"></script>
+ <script src="../../ui/jquery.ui.popup.js"></script>
+ <link href="../demos.css" rel="stylesheet" />
+ <script>
$(function() {
$(".demo button").button({
icons: {
primary: "ui-icon-home",
secondary: "ui-icon-triangle-1-s"
}
- }).each(function() {
- $(this).next().menu({
- select: function(event, ui) {
- $(this).hide();
- $("#log").append("<div>Selected " + ui.item.text() + "</div>");
- }
- }).hide();
- }).click(function(event) {
- var menu = $(this).next();
- if (menu.is(":visible")) {
- menu.hide();
- return false;
+ }).next().menu({
+ select: function(event, ui) {
+ $(this).hide();
+ $("#log").append("<div>Selected " + ui.item.text() + "</div>");
}
- menu.menu("blur").show().position({
- my: "left top",
- at: "right top",
- of: this
- });
- $(document).one("click", function() {
- menu.hide();
- });
- return false;
- })
+ }).popup();
});
</script>
<style>
@@ -69,7 +53,7 @@
<div class="demo-description">
-<p>A simple contextmenu: Click the button, or tab to it and hit space to open the menu. Use the mouse or cursor keys to select an item, click it or hit enter to select it.</p>
+<p>TODO update - A simple contextmenu: Click the button, or tab to it and hit space to open the menu. Use the mouse or cursor keys to select an item, click it or hit enter to select it.</p>
<p>The keyboard handling is part of the menu. Using the input option to menu is configured to add the key event handlers to the button, as that button gets focused when clicked.</p>