aboutsummaryrefslogtreecommitdiffstats
path: root/ui/tests/resizable.js
blob: 1cd3a4816b9c9de6d005072b2ad437608d9bc1a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
var console = console || {
	log: function(l) {
		$('#log').append(l + '<br/>').get(0).scrollTop = 10000;
	}
};

var animateClick = function(co) {
	var img = $("<img src='images/click.png' width='1'>").appendTo("body")
					.css({ position: "absolute", zIndex: 1000, left: co.x, top: co.y })
					.animate({ width: 80, height: 80, left: co.x-40, top: co.y-40, opacity: 'hide' }, 1000, function() { $(this).remove(); });
	};

var num = function(i) {
	return parseInt(i, 10);
};

$(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')			
		}
	});
	
	module("Test 1");
	
	test("simple resize tests", function() {
		
		drag('.ui-resizable-se', 100, 50);
		
	});
	
	
	test("simple resize tests 2", function() {
		
		//drag('.ui-resizable-se', 0, 1000);
		
	});
	
	module("Test 2");
	
	test("simple resize tests", function() {
		
		//drag('.ui-resizable-se', 15, 0);
		
	});
	
});