forked from bitovi/jquerypp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrop_test.js
More file actions
52 lines (40 loc) · 1.14 KB
/
drop_test.js
File metadata and controls
52 lines (40 loc) · 1.14 KB
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
steal("jquerypp/event/drop",'funcunit/syn', 'funcunit/qunit', function($, Syn) {
module("jquerypp/event/drop");
test("new drop added", 3, function(){
var div = $("<div>"+
"<div id='drag'></div>"+
"<div id='midpoint'></div>"+
"<div id='drop'></div>"+
"</div>");
div.appendTo($("#qunit-test-area"));
var basicCss = {
width: "20px",
height: "20px",
position: "absolute",
border: "solid 1px black"
}
$("#drag").css(basicCss).css({top: "0px", left: "0px", zIndex: 1000, backgroundColor: "red"})
$("#midpoint").css(basicCss).css({top: "0px", left: "30px"})
$("#drop").css(basicCss).css({top: "0px", left: "60px"});
$('#drag').bind("draginit", function(){});
$("#midpoint").bind("dropover",function(){
ok(true, "midpoint called");
$("#drop").bind("dropover", function(){
ok(true, "drop called");
});
$('body').on("dropon", function(ev) {
ok(false, 'parent dropon should not be called');
});
$('#drop').on("dropon", function(ev) {
ok(true, 'dropon called');
ev.stopPropagation();
});
$.Drop.compile();
});
stop();
Syn.drag({to: "#drop"},"drag", function(){
$('body').off('dropon');
start();
});
});
})