diff options
author | Scott González <scott.gonzalez@gmail.com> | 2010-01-20 00:04:48 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2010-01-20 00:04:48 +0000 |
commit | 23413d2ebc34cce27d7a682076d7815ffb9ca8d9 (patch) | |
tree | 0c409309cabc5c95957d1f33afa6a5fd330f3046 /tests/visual/compound | |
parent | 010385b2fa4f0656953c2fc70c363c9cd9f74a9d (diff) | |
download | jquery-ui-23413d2ebc34cce27d7a682076d7815ffb9ca8d9.tar.gz jquery-ui-23413d2ebc34cce27d7a682076d7815ffb9ca8d9.zip |
Nested Plugin visual test: draggable inside accordion inside accordion inside tabs inside draggable.
Diffstat (limited to 'tests/visual/compound')
-rw-r--r-- | tests/visual/compound/draggable_accordion.html | 37 | ||||
-rw-r--r-- | tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html | 108 |
2 files changed, 132 insertions, 13 deletions
diff --git a/tests/visual/compound/draggable_accordion.html b/tests/visual/compound/draggable_accordion.html index c56fa4ddf..dcdcf7ba4 100644 --- a/tests/visual/compound/draggable_accordion.html +++ b/tests/visual/compound/draggable_accordion.html @@ -7,23 +7,34 @@ <script type="text/javascript" src="../../../jquery-1.3.2.js"></script> <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script> <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script> + <script type="text/javascript" src="../../../ui/jquery.ui.mouse.js"></script> <script type="text/javascript" src="../../../ui/jquery.ui.accordion.js"></script> <script type="text/javascript" src="../../../ui/jquery.ui.draggable.js"></script> + <style type="text/css"> + .draggable { + width: 10em; + margin: 0.5em; + } + </style> <script type="text/javascript"> $(function() { - $('#accordion').accordion(); - $('#first .draggable').draggable(); - $('#second .draggable').draggable({ - appendTo: 'body' + $( "#accordion" ).accordion(); + $( ".draggable" ).addClass( "ui-widget ui-widget-content ui-corner-all" ) + $( "#first .draggable" ).draggable(); + $( "#second .draggable" ).draggable({ + appendTo: "body" + }); + $( "#third .draggable" ).draggable({ + helper: "clone", + appendTo: "body" }); - $('#third .draggable').draggable(); }); </script> </head> <body> <div id="accordion"> - <h3><a href="#">Accordion Header 1</a></h3> + <h3><a href="#">.draggable()</a></h3> <div id="first"> <div class="draggable">Draggable 1-1</div> <div class="draggable">Draggable 1-2</div> @@ -31,15 +42,15 @@ <div class="draggable">Draggable 1-4</div> <div class="draggable">Draggable 1-5</div> </div> - <h3><a href="#">Accordion Header 2</a></h3> + <h3><a href="#">.draggable({ appendTo: "body" })</a></h3> <div id="second"> - <div class="draggable">Draggable with appendTo 2-1</div> - <div class="draggable">Draggable with appendTo 2-2</div> - <div class="draggable">Draggable with appendTo 2-3</div> - <div class="draggable">Draggable with appendTo 2-4</div> - <div class="draggable">Draggable with appendTo 2-5</div> + <div class="draggable">Draggable 2-1</div> + <div class="draggable">Draggable 2-2</div> + <div class="draggable">Draggable 2-3</div> + <div class="draggable">Draggable 2-4</div> + <div class="draggable">Draggable 2-5</div> </div> - <h3><a href="#">Accordion Header 3</a></h3> + <h3><a href="#">.draggable({ helper: "clone", appendTo: "body" })</a></h3> <div id="third"> <div class="draggable">Draggable 3-1</div> <div class="draggable">Draggable 3-2</div> diff --git a/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html b/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html new file mode 100644 index 000000000..96938ed98 --- /dev/null +++ b/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html @@ -0,0 +1,108 @@ +<!doctype html> +<html lang="en"> +<head> + <title>Compound Visual Test : Draggable in Accordion</title> + <link rel="stylesheet" href="../visual.css" type="text/css" /> + <link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css"> + <script type="text/javascript" src="../../../jquery-1.3.2.js"></script> + <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script> + <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script> + <script type="text/javascript" src="../../../ui/jquery.ui.mouse.js"></script> + <script type="text/javascript" src="../../../ui/jquery.ui.accordion.js"></script> + <script type="text/javascript" src="../../../ui/jquery.ui.draggable.js"></script> + <script type="text/javascript" src="../../../ui/jquery.ui.tabs.js"></script> + <style type="text/css"> + #main-draggable { + width: 300px; + position: absolute; + right: 100px; + } + #main-draggable-handle { + padding: 1em; + margin: 0; + } + .draggable { + width: 10em; + margin: 0.5em; + } + </style> + <script type="text/javascript"> + $(function() { + $( ".draggable" ).addClass( "ui-widget ui-widget-content ui-corner-all" ) + $( ".draggable" ).draggable({ + helper: "clone", + appendTo: "body" + }); + + // PROBLEM: nested accordions must be initialized before outer accordion + $( "#accordion > div" ).accordion(); + $( "#accordion" ).accordion(); + + + // PROBLEM: nested widgets must be initialized before tabs + $( "#tabs" ).tabs(); + + $( "#main-draggable" ).draggable({ + handle: "#main-draggable-handle" + }); + }); + </script> +</head> +<body> +<div id="main-draggable" class="ui-widget ui-widget-content ui-corner-all"> + <p id="main-draggable-handle" class="ui-widget-header ui-corner-all">Drag me around!</p> + <div id="tabs"> + <ul> + <li><a href="#tabs-1">First Tab</a></li> + <li><a href="#tabs-2">Second Tab</a></li> + </ul> + <div id="tabs-1"> + <p>Click the other tab!</p> + </div> + <div id="tabs-2"> + <div id="accordion"> + <h3><a>Accordion Group 1</a></h3> + <div id="accordion-1-1"> + <h3><a href="#">Header 1-1</a></h3> + <div> + <div class="draggable">Draggable 1-1</div> + <div class="draggable">Draggable 1-2</div> + <div class="draggable">Draggable 1-3</div> + <div class="draggable">Draggable 1-4</div> + <div class="draggable">Draggable 1-5</div> + </div> + <h3><a href="#">Header 1-2</a></h3> + <div> + <div class="draggable">Draggable 2-1</div> + <div class="draggable">Draggable 2-2</div> + <div class="draggable">Draggable 2-3</div> + <div class="draggable">Draggable 2-4</div> + <div class="draggable">Draggable 2-5</div> + </div> + </div> + <h3><a>Accordion Group 2</a></h3> + <div id="accordion-1-2"> + <h3><a href="#">Header 2-1</a></h3> + <div> + <div class="draggable">Draggable 1-1</div> + <div class="draggable">Draggable 1-2</div> + <div class="draggable">Draggable 1-3</div> + <div class="draggable">Draggable 1-4</div> + <div class="draggable">Draggable 1-5</div> + </div> + <h3><a href="#">Header 2-2</a></h3> + <div> + <div class="draggable">Draggable 2-1</div> + <div class="draggable">Draggable 2-2</div> + <div class="draggable">Draggable 2-3</div> + <div class="draggable">Draggable 2-4</div> + <div class="draggable">Draggable 2-5</div> + </div> + </div> + </div> + </div> + </div> +</div> + +</body> +</html> |