-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.html
89 lines (79 loc) · 2.13 KB
/
test.html
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<html>
<head>
<title>Fastbinder Test Page</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<script src="jquery.fastbinder.js"></script>
<script>
var MyLib = {};
$(function () {
MyLib.MyController = {};
var methods = [
'testChange',
'testClick',
'testHover',
'testKeyUp',
'testMouseDown',
'testMouseUp',
'testScroll',
'testSubmit'
];
_.each(methods, function (method) {
MyLib.MyController[method] = function (e) {
window.console.log(method, e);
};
});
$.fastbinder();
});
</script>
<style>
body {
margin: 30px;
}
input {
display: block;
margin: 5px 0;
padding: 4px;
width: 300px;
}
a {
display: block;
margin: 5px 0;
}
.scroll-test, .hover-test {
background: #eee;
line-height: 150px;
text-align: center;
margin: 5px;
height: 150px;
width: 300px;
}
.scroll-test-container {
height: 150px;
overflow: auto;
}
.scroll-test {
height: 1000px;
}
</style>
</head>
<body>
<div data-controller="MyLib.MyController">
<input type="text" data-on-change="testChange" value="testChange" />
<a href="#" data-on-click="testClick">testClick</a>
<div class="hover-test" data-on-hover="testHover">testHover</div>
<input type="text" data-on-keyup="testKeyUp" value="testKeyUp" />
<a href="#" data-on-mousedown="testMouseDown">testMouseDown</a>
<a href="#" data-on-mouseup="testMouseUp">testMouseUp</a>
<div class="scroll-test-container" data-on-scroll="testScroll">
<div class="scroll-test" data-on-scroll="testScroll">testScroll</div>
</div>
<form data-on-submit="testSubmit">
<input type="text" value="testSubmit (form)" />
<input type="submit" value="Submit" />
</form>
<input type="text" data-on-submit="testSubmit" value="testSubmit (input)" />
</div>
</body>
</html>