r3204 committed - dev: created a fresh menu branch from trunk
Revision: 3204
Author: paul.bakaus
Date: Fri Sep 11 07:18:23 2009
Log: dev: created a fresh menu branch from trunk
http://code.google.com/p/jquery-ui/source/detail?r=3204
Added:
/branches/dev/menu
Modified:
/branches/dev/menu/demos/droppable/propagation.html
/branches/dev/menu/tests/unit/draggable/draggable_options.js
/branches/dev/menu/tests/visual/draggable/draggable.html
=======================================
--- /trunk/demos/droppable/propagation.html Fri Feb 27 08:57:26 2009
+++ /branches/dev/menu/demos/droppable/propagation.html Fri Sep 11 07:18:23
2009
@@ -9,7 +9,7 @@
<script type="text/javascript" src="../../ui/ui.droppable.js"></script>
<link type="text/css" href="../demos.css" rel="stylesheet" />
<style type="text/css">
- #draggable { width: 100px; height: 40px; padding: 0.5em; float: left;
margin: 10px 10px 10px 0; }
+ #draggable, #draggable2 { width: 100px; height: 40px; padding: 0.5em;
float: left; margin: 10px 10px 10px 0; }
#droppable, #droppable2 { width: 230px; height: 120px; padding: 0.5em;
float: left; margin: 10px; }
#droppable-inner, #droppable2-inner { width: 170px; height: 60px;
padding: 0.5em; float: left; margin: 10px; }
</style>
@@ -17,6 +17,7 @@
$(function() {
$("#draggable").draggable();
+ $("#draggable2").draggable();
$("#droppable, #droppable-inner").droppable({
activeClass: 'ui-state-hover',
@@ -27,7 +28,7 @@
}
});
- $("#droppable2, #droppable2-inner").droppable({
+ $("#droppable2").droppable({
greedy: true,
activeClass: 'ui-state-hover',
hoverClass: 'ui-state-active',
@@ -35,6 +36,16 @@
$(this).addClass('ui-state-highlight').find('> p').html('Dropped!');
}
});
+
+ $("#droppable2-inner").droppable({
+ greedy: true,
+ accept: '#draggable',
+ activeClass: 'ui-state-hover',
+ hoverClass: 'ui-state-active',
+ drop: function(event, ui) {
+ $(this).addClass('ui-state-highlight').find('> p').html('Dropped!');
+ }
+ });
});
</script>
@@ -46,6 +57,10 @@
Drag me to my target
</div>
+<div id="draggable2" class="ui-widget-content">
+ Draggable 2
+</div>
+
<div id="droppable" class="ui-widget-header">
Outer droppable
<div id="droppable-inner" class="ui-widget-header">
=======================================
--- /trunk/tests/unit/draggable/draggable_options.js Mon Aug 3 06:13:13
2009
+++ /branches/dev/menu/tests/unit/draggable/draggable_options.js Fri Sep 11
07:18:23 2009
@@ -42,15 +42,34 @@
test("{ appendTo: 'parent' }, default", function() {
equals(draggable_defaults.appendTo, "parent");
- ok(false, 'missing test - untested code is broken code');
+ el = $("#draggable2").draggable({ appendTo: 'parent' });
+ drag(el, 50, 50);
+ moved(50, 50);
+
+ el = $("#draggable1").draggable({ appendTo: 'parent' });
+ drag(el, 50, 50);
+ moved(50, 50);
+
});
test("{ appendTo: Element }", function() {
- ok(false, 'missing test - untested code is broken code');
+ el = $("#draggable2").draggable({ appendTo: $("#draggable2").parent()[0]
});
+ drag(el, 50, 50);
+ moved(50, 50);
+
+ el = $("#draggable1").draggable({ appendTo: $("#draggable2").parent()[0]
});
+ drag(el, 50, 50);
+ moved(50, 50);
});
test("{ appendTo: Selector }", function() {
- ok(false, 'missing test - untested code is broken code');
+ el = $("#draggable2").draggable({ appendTo: "#main" });
+ drag(el, 50, 50);
+ moved(50, 50);
+
+ el = $("#draggable1").draggable({ appendTo: "#main" });
+ drag(el, 50, 50);
+ moved(50, 50);
});
test("{ axis: false }, default", function() {
=======================================
--- /trunk/tests/visual/draggable/draggable.html Fri Feb 20 03:40:25 2009
+++ /branches/dev/menu/tests/visual/draggable/draggable.html Fri Sep 11
07:18:23 2009
@@ -7,15 +7,43 @@
<script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
<script type="text/javascript" src="../../../ui/ui.core.js"></script>
<script type="text/javascript" src="../../../ui/ui.draggable.js"></script>
+ <style type="text/css" media="screen">
+
+
+ #container {
+ position: relative;
+ width: 500px;
+ height: 500px;
+ z-index: -1000;
+ }
+
+ #drag {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ top: 0;
+ left: 0;
+ background-color: red;
+ }
+
+ </style>
<script type="text/javascript">
$(function() {
- $("#draggable").draggable();
+ $(document).ready(function() {
+ //$('#drag').bind('mousedown', function() {
+ // console.log(1);
+ //});
+
+ //$('#drop').droppable();
+ });
});
</script>
</head>
<body>
-<div id="draggable">
- Draggable
-</div>
+
+ <div id="container">
+ <div id="drag"></div>
+ </div>
+
</body>
</html>