* jQuery UI Selectable 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Selectables
*
* Depends:
* jquery.ui.core.js
* jquery.ui.mouse.js
* jquery.ui.widget.js
*/
(function (a, b) {
a.widget("ui.selectable", a.ui.mouse, {
options: {
appendTo: "body",
autoRefresh: !0,
distance: 0,
filter: "*",
tolerance: "touch"
},
_create: function () {
var b = this;
this.element.addClass("ui-selectable"), this.dragged = !1;
var c;
this.refresh = function () {
c = a(b.options.filter, b.element[0]), c.addClass("ui-selectee"), c.each(function () {
var b = a(this),
c = b.offset();
a.data(this, "selectable-item", {
element: this,
$element: b,
left: c.left,
top: c.top,
right: c.left + b.outerWidth(),
bottom: c.top + b.outerHeight(),
startselected: !1,
selected: b.hasClass("ui-selected"),
selecting: b.hasClass("ui-selecting"),
unselecting: b.hasClass("ui-unselecting")
})
})
}, this.refresh(), this.selectees = c.addClass("ui-selectee"), this._mouseInit(), this.helper = a("<div class='ui-selectable-helper'></div>")
},
destroy: function () {
this.selectees.removeClass("ui-selectee").removeData("selectable-item"), this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"), this._mouseDestroy();
return this
},
_mouseStart: function (b) {
var c = this;
this.opos = [b.pageX, b.pageY];
if (!this.options.disabled) {
var d = this.options;
this.selectees = a(d.filter, this.element[0]), this._trigger("start", b), a(d.appendTo).append(this.helper), this.helper.css({
left: b.clientX, // 이부분을 left: b.clickX + 1,
top: b.clientY, // 이부분을 top: b.clickY + 1, 로 변경하면 dblclick() 이 잘 적용된다.. jquery 오류
width: 0,
height: 0
}), d.autoRefresh && this.refresh(), this.selectees.filter(".ui-selected").each(function () {
var d = a.data(this, "selectable-item");
d.startselected = !0, !b.metaKey && !b.ctrlKey && (d.$element.removeClass("ui-selected"), d.selected = !1, d.$element.addClass("ui-unselecting"), d.unselecting = !0, c._trigger("unselecting", b, {
unselecting: d.element
}))
}), a(b.target).parents().andSelf().each(function () {
var d = a.data(this, "selectable-item");
if (d) {
var e = !b.metaKey && !b.ctrlKey || !d.$element.hasClass("ui-selected");
d.$element.removeClass(e ? "ui-unselecting" : "ui-selected").addClass(e ? "ui-selecting" : "ui-unselecting"), d.unselecting = !e, d.selecting = e, d.selected = e, e ? c._trigger("selecting", b, {
selecting: d.element
}) : c._trigger("unselecting", b, {
unselecting: d.element
});
return !1
}
})
}
},
_mouseDrag: function (b) {
var c = this;
this.dragged = !0;
if (!this.options.disabled) {
var d = this.options,
e = this.opos[0],
f = this.opos[1],
g = b.pageX,
h = b.pageY;
if (e > g) {
var i = g;
g = e, e = i
}
if (f > h) {
var i = h;
h = f, f = i
}
this.helper.css({
left: e,
top: f,
width: g - e,
height: h - f
}), this.selectees.each(function () {
var i = a.data(this, "selectable-item");
if ( !! i && i.element != c.element[0]) {
var j = !1;
d.tolerance == "touch" ? j = !(i.left > g || i.right < e || i.top > h || i.bottom < f) : d.tolerance == "fit" && (j = i.left > e && i.right < g && i.top > f && i.bottom < h), j ? (i.selected && (i.$element.removeClass("ui-selected"), i.selected = !1), i.unselecting && (i.$element.removeClass("ui-unselecting"), i.unselecting = !1), i.selecting || (i.$element.addClass("ui-selecting"), i.selecting = !0, c._trigger("selecting", b, {
selecting: i.element
}))) : (i.selecting && ((b.metaKey || b.ctrlKey) && i.startselected ? (i.$element.removeClass("ui-selecting"), i.selecting = !1, i.$element.addClass("ui-selected"), i.selected = !0) : (i.$element.removeClass("ui-selecting"), i.selecting = !1, i.startselected && (i.$element.addClass("ui-unselecting"), i.unselecting = !0), c._trigger("unselecting", b, {
unselecting: i.element
}))), i.selected && !b.metaKey && !b.ctrlKey && !i.startselected && (i.$element.removeClass("ui-selected"), i.selected = !1, i.$element.addClass("ui-unselecting"), i.unselecting = !0, c._trigger("unselecting", b, {
unselecting: i.element
})))
}
});
return !1
}
},
_mouseStop: function (b) {
var c = this;
this.dragged = !1;
var d = this.options;
a(".ui-unselecting", this.element[0]).each(function () {
var d = a.data(this, "selectable-item");
d.$element.removeClass("ui-unselecting"), d.unselecting = !1, d.startselected = !1, c._trigger("unselected", b, {
unselected: d.element
})
}), a(".ui-selecting", this.element[0]).each(function () {
var d = a.data(this, "selectable-item");
d.$element.removeClass("ui-selecting").addClass("ui-selected"), d.selecting = !1, d.selected = !0, d.startselected = !0, c._trigger("selected", b, {
selected: d.element
})
}), this._trigger("stop", b), this.helper.remove();
return !1
}
}), a.extend(a.ui.selectable, {
version: "1.8.17"
})
})(jQuery);
'IT > 예외처리' 카테고리의 다른 글
Error getting generated key or setting result to parameter object (0) | 2014.07.14 |
---|---|
톰캣 구동 시 에러 (0) | 2013.12.24 |
ORA-01861: 리터럴이 형식 문자열과 일치하지 않음 (0) | 2013.12.24 |
MySQL 외부 접속 (ERROR 1130 (00000): Host 'x.x.x.x' is not allowed to connect to this MySQL server) (0) | 2013.12.24 |
Cannot find a valid baseurl for repo (0) | 2013.12.23 |