mouse.min.js
4.01 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*!
* jQuery UI Mouse 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/mouse/
*/
!function (a) {
"function" == typeof define && define.amd ? define(["jquery", "./widget"], a) : a(jQuery)
}(function (a) {
var b = !1;
return a(document).mouseup(function () {
b = !1
}), a.widget("ui.mouse", {
version: "1.11.4",
options: {cancel: "input,textarea,button,select,option", distance: 1, delay: 0},
_mouseInit: function () {
var b = this;
this.element.bind("mousedown." + this.widgetName, function (a) {
return b._mouseDown(a)
}).bind("click." + this.widgetName, function (c) {
if (!0 === a.data(c.target, b.widgetName + ".preventClickEvent"))return a.removeData(c.target, b.widgetName + ".preventClickEvent"), c.stopImmediatePropagation(), !1
}), this.started = !1
},
_mouseDestroy: function () {
this.element.unbind("." + this.widgetName), this._mouseMoveDelegate && this.document.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate)
},
_mouseDown: function (c) {
if (!b) {
this._mouseMoved = !1, this._mouseStarted && this._mouseUp(c), this._mouseDownEvent = c;
var d = this, e = 1 === c.which, f = !("string" != typeof this.options.cancel || !c.target.nodeName) && a(c.target).closest(this.options.cancel).length;
return !(e && !f && this._mouseCapture(c)) || (this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function () {
d.mouseDelayMet = !0
}, this.options.delay)), this._mouseDistanceMet(c) && this._mouseDelayMet(c) && (this._mouseStarted = this._mouseStart(c) !== !1, !this._mouseStarted) ? (c.preventDefault(), !0) : (!0 === a.data(c.target, this.widgetName + ".preventClickEvent") && a.removeData(c.target, this.widgetName + ".preventClickEvent"), this._mouseMoveDelegate = function (a) {
return d._mouseMove(a)
}, this._mouseUpDelegate = function (a) {
return d._mouseUp(a)
}, this.document.bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate), c.preventDefault(), b = !0, !0))
}
},
_mouseMove: function (b) {
if (this._mouseMoved) {
if (a.ui.ie && (!document.documentMode || document.documentMode < 9) && !b.button)return this._mouseUp(b);
if (!b.which)return this._mouseUp(b)
}
return (b.which || b.button) && (this._mouseMoved = !0), this._mouseStarted ? (this._mouseDrag(b), b.preventDefault()) : (this._mouseDistanceMet(b) && this._mouseDelayMet(b) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, b) !== !1, this._mouseStarted ? this._mouseDrag(b) : this._mouseUp(b)), !this._mouseStarted)
},
_mouseUp: function (c) {
return this.document.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, c.target === this._mouseDownEvent.target && a.data(c.target, this.widgetName + ".preventClickEvent", !0), this._mouseStop(c)), b = !1, !1
},
_mouseDistanceMet: function (a) {
return Math.max(Math.abs(this._mouseDownEvent.pageX - a.pageX), Math.abs(this._mouseDownEvent.pageY - a.pageY)) >= this.options.distance
},
_mouseDelayMet: function () {
return this.mouseDelayMet
},
_mouseStart: function () {
},
_mouseDrag: function () {
},
_mouseStop: function () {
},
_mouseCapture: function () {
return !0
}
})
});