aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEduardo Lundgren <eduardolundgren@gmail.com>2008-05-30 23:36:54 +0000
committerEduardo Lundgren <eduardolundgren@gmail.com>2008-05-30 23:36:54 +0000
commit956656bc2a09790dc2ba6f4bea27d288afd61c91 (patch)
treee4298809984d22831d5a0c2308e3e35224b8347d
parente175417d95bd4dc45edee1dbfd7b5b6cc6e76e69 (diff)
downloadjquery-ui-956656bc2a09790dc2ba6f4bea27d288afd61c91.tar.gz
jquery-ui-956656bc2a09790dc2ba6f4bea27d288afd61c91.zip
Starting alpha tests using userAction syncrhonous drag
-rw-r--r--ui/tests/resizable.html2
-rw-r--r--ui/tests/resizable.js60
2 files changed, 28 insertions, 34 deletions
diff --git a/ui/tests/resizable.html b/ui/tests/resizable.html
index 4580fbf2d..80ff15359 100644
--- a/ui/tests/resizable.html
+++ b/ui/tests/resizable.html
@@ -32,7 +32,7 @@
<h2 id="log" style="height: 50px;overflow-y:auto;"></h2>
<div id="main" style="border: 1px solid black; padding: 10px; margin: 10px;">
- <div id='resizable1' style="background: green; width: 200px; height: 100px;">I'm a resizable.</div>
+ <div id='resizable1' style="background: green; width: 100px; height: 100px;">I'm a resizable.</div>
</div>
<ol id="tests"></ol>
diff --git a/ui/tests/resizable.js b/ui/tests/resizable.js
index d561f32a6..1cd3a4816 100644
--- a/ui/tests/resizable.js
+++ b/ui/tests/resizable.js
@@ -15,50 +15,44 @@ var num = function(i) {
};
$(document).ready(function() {
-
-
+
+ var drag = function(el, dx, dy, complete) {
+
+ // speed = sync -> Drag syncrhonously.
+ // speed = fast|slow -> Drag asyncrhonously - animated.
+
+ $(el).userAction("drag", {
+ dx: dx, dy: dy, speed: 'sync', complete: complete
+ });
+ };
+
$('#resizable1').resizable({
resize: function() {
- //console.log('resize')
+ console.log('resize')
}
});
- $('.ui-resizable-se').userAction("drag", 100);
- $('.ui-resizable-se').userAction("drag", 200, 50);
- $('.ui-resizable-se').userAction("drag", 400);
- $('.ui-resizable-se').userAction("drag", -600, -30);
+ module("Test 1");
- return;
-
- module("resizable: simple resize");
+ test("simple resize tests", function() {
+
+ drag('.ui-resizable-se', 100, 50);
+
+ });
- test("simple resize x", function() {
-
- $('#resizable1').resizable({
- resize: function() {
- console.log('resize')
- }
- });
+
+ test("simple resize tests 2", function() {
- $('.ui-resizable-e').userAction("drag", 100);
- $('.ui-resizable-e').userAction("drag", 200);
- $('.ui-resizable-e').userAction("drag", 200);
+ //drag('.ui-resizable-se', 0, 1000);
- //expect(2);
- //ok(false, "Resize element on the same position");
+ });
+
+ module("Test 2");
+
+ test("simple resize tests", function() {
+ //drag('.ui-resizable-se', 15, 0);
});
- /*test("autoheight", function() {
- $('#navigation').accordion({ header: '.head', autoheight: false });
- equals( 90, $('#navigation ul:first').height() );
- equals( 126, $('#navigation ul:eq(1)').height() );
- equals( 54, $('#navigation ul:last').height() );
- $('#navigation').accordion("destroy").accordion({ header: '.head',autoheight: true });
- equals( 126, $('#navigation ul:first').height() );
- equals( 126, $('#navigation ul:eq(1)').height() );
- equals( 126, $('#navigation ul:last').height() );
- });*/
-
}); \ No newline at end of file