-
Notifications
You must be signed in to change notification settings - Fork 83
/
MOOTOOLS-MORE.txt
64 lines (51 loc) · 2.47 KB
/
MOOTOOLS-MORE.txt
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
MOOTOOLS MORE and MochaUI's ability to Drag & Drop on Mobile Devices
MochaUI is amazing on desktops but weak on mobile devices, which needs to be solved
in order to stay current and relevant.
Adapting a project of mine to mobile devices has been challenging due to this issues,
because it's important to make MochaUI work with updated versions of MooTools and
mobile devices.
In order to accomplish this, a few tweeks needs to be done in MooTools's More Drag.js
to add the touchable events needed in MochaUI.
Here's a list of the changes in MooTools More 1.5.1, Drag.js:
attach: function(){
this.handles.addEvent("mousedown", this.bound.start);
+ this.handles.addEvent("touchstart", this.bound.start);
detach: function(){
this.handles.removeEvent("mousedown", this.bound.start);
+ this.handles.removeEvent("touchstart", this.bound.start);
start: function(event){
var options = this.options;
(about 36 lines below)
var events = {
mousemove: this.bound.check,
+ touchmove: this.bound.check,
mouseup: this.bound.cancel,
+ touchend: this.bound.cancel
};
check: function(event){
(about 6 lines below)
this.document.addEvents({
mousemove: this.bound.drag,
+ touchmove: this.bound.drag,
mouseup: this.bound.stop,
+ touchend: this.bound.stop
});
cancel: function(event){
this.document.removeEvents({
mousemove: this.bound.check,
+ touchmove: this.bound.check,
mouseup: this.bound.cancel,
+ touchend: this.bound.cancel
});
stop: function(event){
var events = {
mousemove: this.bound.drag,
+ touchmove: this.bound.drag,
mouseup: this.bound.stop,
+ touchend: this.bound.stop
};
After this changes, MochaUI's Drag & Drop abilities were fully functional again.
This is only a partial solution since newer versions of MooTools More Drag.js need
to be changed until a definite solution for touchable events are implemented inside
MooTools.
Regards.