jquery_rails3 1.4.2.b2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/lib/generators/{jquery_install → jquery/install}/USAGE +3 -2
- data/lib/generators/jquery/install/install_generator.rb +40 -0
- data/lib/jquery_rails3.rb +11 -0
- metadata +13 -186
- data/lib/generators/jquery_install/jquery_install_generator.rb +0 -102
- data/lib/generators/jquery_install/templates/jquery-1.4.2.js +0 -6240
- data/lib/generators/jquery_install/templates/jquery-1.4.2.min.js +0 -154
- data/lib/generators/jquery_install/templates/layout.html.erb +0 -14
- data/lib/generators/jquery_install/templates/rails.js +0 -132
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_222222_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_454545_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_888888_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.accordion.css +0 -19
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.all.css +0 -11
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.autocomplete.css +0 -53
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.base.css +0 -11
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.button.css +0 -38
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.core.css +0 -41
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.datepicker.css +0 -68
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.dialog.css +0 -21
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.progressbar.css +0 -11
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.resizable.css +0 -20
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.selectable.css +0 -10
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.slider.css +0 -24
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.tabs.css +0 -18
- data/lib/generators/jquery_install/templates/themes/base/jquery.ui.theme.css +0 -252
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery-ui-1.8.4.custom.css +0 -572
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.accordion.css +0 -19
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.all.css +0 -11
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.autocomplete.css +0 -53
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.base.css +0 -11
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.button.css +0 -38
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.core.css +0 -41
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.datepicker.css +0 -68
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.dialog.css +0 -21
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.progressbar.css +0 -11
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.resizable.css +0 -20
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.selectable.css +0 -10
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.slider.css +0 -24
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.tabs.css +0 -18
- data/lib/generators/jquery_install/templates/themes/smoothness/jquery.ui.theme.css +0 -254
- data/lib/generators/jquery_install/templates/ui/i18n/jquery-ui-i18n.js +0 -1176
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-af.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ar.js +0 -24
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-az.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-bg.js +0 -24
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-bs.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ca.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-cs.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-da.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-de.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-el.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-en-GB.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-eo.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-es.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-et.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-eu.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fa.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fi.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fo.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fr-CH.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-fr.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-he.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-hr.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-hu.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-hy.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-id.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-is.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-it.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ja.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ko.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-lt.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-lv.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ms.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-nl.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-no.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-pl.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-pt-BR.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ro.js +0 -26
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ru.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sk.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sl.js +0 -24
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sq.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sr-SR.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sr.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-sv.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-ta.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-th.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-tr.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-uk.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-vi.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-zh-CN.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-zh-HK.js +0 -23
- data/lib/generators/jquery_install/templates/ui/i18n/jquery.ui.datepicker-zh-TW.js +0 -23
- data/lib/generators/jquery_install/templates/ui/jquery-ui-1.8.4.custom.js +0 -11241
- data/lib/generators/jquery_install/templates/ui/jquery.effects.blind.js +0 -49
- data/lib/generators/jquery_install/templates/ui/jquery.effects.bounce.js +0 -78
- data/lib/generators/jquery_install/templates/ui/jquery.effects.clip.js +0 -54
- data/lib/generators/jquery_install/templates/ui/jquery.effects.core.js +0 -714
- data/lib/generators/jquery_install/templates/ui/jquery.effects.drop.js +0 -50
- data/lib/generators/jquery_install/templates/ui/jquery.effects.explode.js +0 -79
- data/lib/generators/jquery_install/templates/ui/jquery.effects.fold.js +0 -56
- data/lib/generators/jquery_install/templates/ui/jquery.effects.highlight.js +0 -50
- data/lib/generators/jquery_install/templates/ui/jquery.effects.pulsate.js +0 -51
- data/lib/generators/jquery_install/templates/ui/jquery.effects.scale.js +0 -178
- data/lib/generators/jquery_install/templates/ui/jquery.effects.shake.js +0 -57
- data/lib/generators/jquery_install/templates/ui/jquery.effects.slide.js +0 -50
- data/lib/generators/jquery_install/templates/ui/jquery.effects.transfer.js +0 -45
- data/lib/generators/jquery_install/templates/ui/jquery.ui.accordion.js +0 -598
- data/lib/generators/jquery_install/templates/ui/jquery.ui.autocomplete.js +0 -544
- data/lib/generators/jquery_install/templates/ui/jquery.ui.button.js +0 -365
- data/lib/generators/jquery_install/templates/ui/jquery.ui.core.js +0 -281
- data/lib/generators/jquery_install/templates/ui/jquery.ui.datepicker.js +0 -1732
- data/lib/generators/jquery_install/templates/ui/jquery.ui.dialog.js +0 -827
- data/lib/generators/jquery_install/templates/ui/jquery.ui.draggable.js +0 -797
- data/lib/generators/jquery_install/templates/ui/jquery.ui.droppable.js +0 -285
- data/lib/generators/jquery_install/templates/ui/jquery.ui.mouse.js +0 -151
- data/lib/generators/jquery_install/templates/ui/jquery.ui.position.js +0 -233
- data/lib/generators/jquery_install/templates/ui/jquery.ui.progressbar.js +0 -94
- data/lib/generators/jquery_install/templates/ui/jquery.ui.resizable.js +0 -812
- data/lib/generators/jquery_install/templates/ui/jquery.ui.selectable.js +0 -266
- data/lib/generators/jquery_install/templates/ui/jquery.ui.slider.js +0 -680
- data/lib/generators/jquery_install/templates/ui/jquery.ui.sortable.js +0 -1071
- data/lib/generators/jquery_install/templates/ui/jquery.ui.tabs.js +0 -757
- data/lib/generators/jquery_install/templates/ui/jquery.ui.widget.js +0 -237
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.blind.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.bounce.min.js +0 -15
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.clip.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.core.min.js +0 -30
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.drop.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.explode.min.js +0 -15
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.fold.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.highlight.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.pulsate.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.scale.min.js +0 -20
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.shake.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.slide.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.effects.transfer.min.js +0 -14
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.accordion.min.js +0 -30
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.autocomplete.min.js +0 -31
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.button.min.js +0 -24
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.core.min.js +0 -17
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.datepicker.min.js +0 -80
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.dialog.min.js +0 -39
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.draggable.min.js +0 -49
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.droppable.min.js +0 -26
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.mouse.min.js +0 -17
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.position.min.js +0 -15
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.progressbar.min.js +0 -16
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.resizable.min.js +0 -47
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.selectable.min.js +0 -22
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.slider.min.js +0 -33
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.sortable.min.js +0 -60
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.tabs.min.js +0 -35
- data/lib/generators/jquery_install/templates/ui-min/jquery.ui.widget.min.js +0 -15
@@ -1,285 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery UI Droppable 1.8.4
|
3
|
-
*
|
4
|
-
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
5
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6
|
-
* http://jquery.org/license
|
7
|
-
*
|
8
|
-
* http://docs.jquery.com/UI/Droppables
|
9
|
-
*
|
10
|
-
* Depends:
|
11
|
-
* jquery.ui.core.js
|
12
|
-
* jquery.ui.widget.js
|
13
|
-
* jquery.ui.mouse.js
|
14
|
-
* jquery.ui.draggable.js
|
15
|
-
*/
|
16
|
-
(function( $, undefined ) {
|
17
|
-
|
18
|
-
$.widget("ui.droppable", {
|
19
|
-
widgetEventPrefix: "drop",
|
20
|
-
options: {
|
21
|
-
accept: '*',
|
22
|
-
activeClass: false,
|
23
|
-
addClasses: true,
|
24
|
-
greedy: false,
|
25
|
-
hoverClass: false,
|
26
|
-
scope: 'default',
|
27
|
-
tolerance: 'intersect'
|
28
|
-
},
|
29
|
-
_create: function() {
|
30
|
-
|
31
|
-
var o = this.options, accept = o.accept;
|
32
|
-
this.isover = 0; this.isout = 1;
|
33
|
-
|
34
|
-
this.accept = $.isFunction(accept) ? accept : function(d) {
|
35
|
-
return d.is(accept);
|
36
|
-
};
|
37
|
-
|
38
|
-
//Store the droppable's proportions
|
39
|
-
this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
|
40
|
-
|
41
|
-
// Add the reference and positions to the manager
|
42
|
-
$.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || [];
|
43
|
-
$.ui.ddmanager.droppables[o.scope].push(this);
|
44
|
-
|
45
|
-
(o.addClasses && this.element.addClass("ui-droppable"));
|
46
|
-
|
47
|
-
},
|
48
|
-
|
49
|
-
destroy: function() {
|
50
|
-
var drop = $.ui.ddmanager.droppables[this.options.scope];
|
51
|
-
for ( var i = 0; i < drop.length; i++ )
|
52
|
-
if ( drop[i] == this )
|
53
|
-
drop.splice(i, 1);
|
54
|
-
|
55
|
-
this.element
|
56
|
-
.removeClass("ui-droppable ui-droppable-disabled")
|
57
|
-
.removeData("droppable")
|
58
|
-
.unbind(".droppable");
|
59
|
-
|
60
|
-
return this;
|
61
|
-
},
|
62
|
-
|
63
|
-
_setOption: function(key, value) {
|
64
|
-
|
65
|
-
if(key == 'accept') {
|
66
|
-
this.accept = $.isFunction(value) ? value : function(d) {
|
67
|
-
return d.is(value);
|
68
|
-
};
|
69
|
-
}
|
70
|
-
$.Widget.prototype._setOption.apply(this, arguments);
|
71
|
-
},
|
72
|
-
|
73
|
-
_activate: function(event) {
|
74
|
-
var draggable = $.ui.ddmanager.current;
|
75
|
-
if(this.options.activeClass) this.element.addClass(this.options.activeClass);
|
76
|
-
(draggable && this._trigger('activate', event, this.ui(draggable)));
|
77
|
-
},
|
78
|
-
|
79
|
-
_deactivate: function(event) {
|
80
|
-
var draggable = $.ui.ddmanager.current;
|
81
|
-
if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
|
82
|
-
(draggable && this._trigger('deactivate', event, this.ui(draggable)));
|
83
|
-
},
|
84
|
-
|
85
|
-
_over: function(event) {
|
86
|
-
|
87
|
-
var draggable = $.ui.ddmanager.current;
|
88
|
-
if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
|
89
|
-
|
90
|
-
if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
|
91
|
-
if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
|
92
|
-
this._trigger('over', event, this.ui(draggable));
|
93
|
-
}
|
94
|
-
|
95
|
-
},
|
96
|
-
|
97
|
-
_out: function(event) {
|
98
|
-
|
99
|
-
var draggable = $.ui.ddmanager.current;
|
100
|
-
if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
|
101
|
-
|
102
|
-
if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
|
103
|
-
if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
|
104
|
-
this._trigger('out', event, this.ui(draggable));
|
105
|
-
}
|
106
|
-
|
107
|
-
},
|
108
|
-
|
109
|
-
_drop: function(event,custom) {
|
110
|
-
|
111
|
-
var draggable = custom || $.ui.ddmanager.current;
|
112
|
-
if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
|
113
|
-
|
114
|
-
var childrenIntersection = false;
|
115
|
-
this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
|
116
|
-
var inst = $.data(this, 'droppable');
|
117
|
-
if(
|
118
|
-
inst.options.greedy
|
119
|
-
&& !inst.options.disabled
|
120
|
-
&& inst.options.scope == draggable.options.scope
|
121
|
-
&& inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element))
|
122
|
-
&& $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)
|
123
|
-
) { childrenIntersection = true; return false; }
|
124
|
-
});
|
125
|
-
if(childrenIntersection) return false;
|
126
|
-
|
127
|
-
if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
|
128
|
-
if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
|
129
|
-
if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
|
130
|
-
this._trigger('drop', event, this.ui(draggable));
|
131
|
-
return this.element;
|
132
|
-
}
|
133
|
-
|
134
|
-
return false;
|
135
|
-
|
136
|
-
},
|
137
|
-
|
138
|
-
ui: function(c) {
|
139
|
-
return {
|
140
|
-
draggable: (c.currentItem || c.element),
|
141
|
-
helper: c.helper,
|
142
|
-
position: c.position,
|
143
|
-
offset: c.positionAbs
|
144
|
-
};
|
145
|
-
}
|
146
|
-
|
147
|
-
});
|
148
|
-
|
149
|
-
$.extend($.ui.droppable, {
|
150
|
-
version: "1.8.4"
|
151
|
-
});
|
152
|
-
|
153
|
-
$.ui.intersect = function(draggable, droppable, toleranceMode) {
|
154
|
-
|
155
|
-
if (!droppable.offset) return false;
|
156
|
-
|
157
|
-
var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
|
158
|
-
y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
|
159
|
-
var l = droppable.offset.left, r = l + droppable.proportions.width,
|
160
|
-
t = droppable.offset.top, b = t + droppable.proportions.height;
|
161
|
-
|
162
|
-
switch (toleranceMode) {
|
163
|
-
case 'fit':
|
164
|
-
return (l <= x1 && x2 <= r
|
165
|
-
&& t <= y1 && y2 <= b);
|
166
|
-
break;
|
167
|
-
case 'intersect':
|
168
|
-
return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
|
169
|
-
&& x2 - (draggable.helperProportions.width / 2) < r // Left Half
|
170
|
-
&& t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
|
171
|
-
&& y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
|
172
|
-
break;
|
173
|
-
case 'pointer':
|
174
|
-
var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
|
175
|
-
draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
|
176
|
-
isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
|
177
|
-
return isOver;
|
178
|
-
break;
|
179
|
-
case 'touch':
|
180
|
-
return (
|
181
|
-
(y1 >= t && y1 <= b) || // Top edge touching
|
182
|
-
(y2 >= t && y2 <= b) || // Bottom edge touching
|
183
|
-
(y1 < t && y2 > b) // Surrounded vertically
|
184
|
-
) && (
|
185
|
-
(x1 >= l && x1 <= r) || // Left edge touching
|
186
|
-
(x2 >= l && x2 <= r) || // Right edge touching
|
187
|
-
(x1 < l && x2 > r) // Surrounded horizontally
|
188
|
-
);
|
189
|
-
break;
|
190
|
-
default:
|
191
|
-
return false;
|
192
|
-
break;
|
193
|
-
}
|
194
|
-
|
195
|
-
};
|
196
|
-
|
197
|
-
/*
|
198
|
-
This manager tracks offsets of draggables and droppables
|
199
|
-
*/
|
200
|
-
$.ui.ddmanager = {
|
201
|
-
current: null,
|
202
|
-
droppables: { 'default': [] },
|
203
|
-
prepareOffsets: function(t, event) {
|
204
|
-
|
205
|
-
var m = $.ui.ddmanager.droppables[t.options.scope] || [];
|
206
|
-
var type = event ? event.type : null; // workaround for #2317
|
207
|
-
var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
|
208
|
-
|
209
|
-
droppablesLoop: for (var i = 0; i < m.length; i++) {
|
210
|
-
|
211
|
-
if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted
|
212
|
-
for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
|
213
|
-
m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue
|
214
|
-
|
215
|
-
m[i].offset = m[i].element.offset();
|
216
|
-
m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
|
217
|
-
|
218
|
-
if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
|
219
|
-
|
220
|
-
}
|
221
|
-
|
222
|
-
},
|
223
|
-
drop: function(draggable, event) {
|
224
|
-
|
225
|
-
var dropped = false;
|
226
|
-
$.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {
|
227
|
-
|
228
|
-
if(!this.options) return;
|
229
|
-
if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
|
230
|
-
dropped = dropped || this._drop.call(this, event);
|
231
|
-
|
232
|
-
if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
|
233
|
-
this.isout = 1; this.isover = 0;
|
234
|
-
this._deactivate.call(this, event);
|
235
|
-
}
|
236
|
-
|
237
|
-
});
|
238
|
-
return dropped;
|
239
|
-
|
240
|
-
},
|
241
|
-
drag: function(draggable, event) {
|
242
|
-
|
243
|
-
//If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
|
244
|
-
if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
|
245
|
-
|
246
|
-
//Run through all droppables and check their positions based on specific tolerance options
|
247
|
-
$.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {
|
248
|
-
|
249
|
-
if(this.options.disabled || this.greedyChild || !this.visible) return;
|
250
|
-
var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
|
251
|
-
|
252
|
-
var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
|
253
|
-
if(!c) return;
|
254
|
-
|
255
|
-
var parentInstance;
|
256
|
-
if (this.options.greedy) {
|
257
|
-
var parent = this.element.parents(':data(droppable):eq(0)');
|
258
|
-
if (parent.length) {
|
259
|
-
parentInstance = $.data(parent[0], 'droppable');
|
260
|
-
parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
|
261
|
-
}
|
262
|
-
}
|
263
|
-
|
264
|
-
// we just moved into a greedy child
|
265
|
-
if (parentInstance && c == 'isover') {
|
266
|
-
parentInstance['isover'] = 0;
|
267
|
-
parentInstance['isout'] = 1;
|
268
|
-
parentInstance._out.call(parentInstance, event);
|
269
|
-
}
|
270
|
-
|
271
|
-
this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
|
272
|
-
this[c == "isover" ? "_over" : "_out"].call(this, event);
|
273
|
-
|
274
|
-
// we just moved out of a greedy child
|
275
|
-
if (parentInstance && c == 'isout') {
|
276
|
-
parentInstance['isout'] = 0;
|
277
|
-
parentInstance['isover'] = 1;
|
278
|
-
parentInstance._over.call(parentInstance, event);
|
279
|
-
}
|
280
|
-
});
|
281
|
-
|
282
|
-
}
|
283
|
-
};
|
284
|
-
|
285
|
-
})(jQuery);
|
@@ -1,151 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* jQuery UI Mouse 1.8.4
|
3
|
-
*
|
4
|
-
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
5
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6
|
-
* http://jquery.org/license
|
7
|
-
*
|
8
|
-
* http://docs.jquery.com/UI/Mouse
|
9
|
-
*
|
10
|
-
* Depends:
|
11
|
-
* jquery.ui.widget.js
|
12
|
-
*/
|
13
|
-
(function( $, undefined ) {
|
14
|
-
|
15
|
-
$.widget("ui.mouse", {
|
16
|
-
options: {
|
17
|
-
cancel: ':input,option',
|
18
|
-
distance: 1,
|
19
|
-
delay: 0
|
20
|
-
},
|
21
|
-
_mouseInit: function() {
|
22
|
-
var self = this;
|
23
|
-
|
24
|
-
this.element
|
25
|
-
.bind('mousedown.'+this.widgetName, function(event) {
|
26
|
-
return self._mouseDown(event);
|
27
|
-
})
|
28
|
-
.bind('click.'+this.widgetName, function(event) {
|
29
|
-
if(self._preventClickEvent) {
|
30
|
-
self._preventClickEvent = false;
|
31
|
-
event.stopImmediatePropagation();
|
32
|
-
return false;
|
33
|
-
}
|
34
|
-
});
|
35
|
-
|
36
|
-
this.started = false;
|
37
|
-
},
|
38
|
-
|
39
|
-
// TODO: make sure destroying one instance of mouse doesn't mess with
|
40
|
-
// other instances of mouse
|
41
|
-
_mouseDestroy: function() {
|
42
|
-
this.element.unbind('.'+this.widgetName);
|
43
|
-
},
|
44
|
-
|
45
|
-
_mouseDown: function(event) {
|
46
|
-
// don't let more than one widget handle mouseStart
|
47
|
-
// TODO: figure out why we have to use originalEvent
|
48
|
-
event.originalEvent = event.originalEvent || {};
|
49
|
-
if (event.originalEvent.mouseHandled) { return; }
|
50
|
-
|
51
|
-
// we may have missed mouseup (out of window)
|
52
|
-
(this._mouseStarted && this._mouseUp(event));
|
53
|
-
|
54
|
-
this._mouseDownEvent = event;
|
55
|
-
|
56
|
-
var self = this,
|
57
|
-
btnIsLeft = (event.which == 1),
|
58
|
-
elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
|
59
|
-
if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
|
60
|
-
return true;
|
61
|
-
}
|
62
|
-
|
63
|
-
this.mouseDelayMet = !this.options.delay;
|
64
|
-
if (!this.mouseDelayMet) {
|
65
|
-
this._mouseDelayTimer = setTimeout(function() {
|
66
|
-
self.mouseDelayMet = true;
|
67
|
-
}, this.options.delay);
|
68
|
-
}
|
69
|
-
|
70
|
-
if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
|
71
|
-
this._mouseStarted = (this._mouseStart(event) !== false);
|
72
|
-
if (!this._mouseStarted) {
|
73
|
-
event.preventDefault();
|
74
|
-
return true;
|
75
|
-
}
|
76
|
-
}
|
77
|
-
|
78
|
-
// these delegates are required to keep context
|
79
|
-
this._mouseMoveDelegate = function(event) {
|
80
|
-
return self._mouseMove(event);
|
81
|
-
};
|
82
|
-
this._mouseUpDelegate = function(event) {
|
83
|
-
return self._mouseUp(event);
|
84
|
-
};
|
85
|
-
$(document)
|
86
|
-
.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
|
87
|
-
.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
|
88
|
-
|
89
|
-
// preventDefault() is used to prevent the selection of text here -
|
90
|
-
// however, in Safari, this causes select boxes not to be selectable
|
91
|
-
// anymore, so this fix is needed
|
92
|
-
($.browser.safari || event.preventDefault());
|
93
|
-
|
94
|
-
event.originalEvent.mouseHandled = true;
|
95
|
-
return true;
|
96
|
-
},
|
97
|
-
|
98
|
-
_mouseMove: function(event) {
|
99
|
-
// IE mouseup check - mouseup happened when mouse was out of window
|
100
|
-
if ($.browser.msie && !event.button) {
|
101
|
-
return this._mouseUp(event);
|
102
|
-
}
|
103
|
-
|
104
|
-
if (this._mouseStarted) {
|
105
|
-
this._mouseDrag(event);
|
106
|
-
return event.preventDefault();
|
107
|
-
}
|
108
|
-
|
109
|
-
if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
|
110
|
-
this._mouseStarted =
|
111
|
-
(this._mouseStart(this._mouseDownEvent, event) !== false);
|
112
|
-
(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
|
113
|
-
}
|
114
|
-
|
115
|
-
return !this._mouseStarted;
|
116
|
-
},
|
117
|
-
|
118
|
-
_mouseUp: function(event) {
|
119
|
-
$(document)
|
120
|
-
.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
|
121
|
-
.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
|
122
|
-
|
123
|
-
if (this._mouseStarted) {
|
124
|
-
this._mouseStarted = false;
|
125
|
-
this._preventClickEvent = (event.target == this._mouseDownEvent.target);
|
126
|
-
this._mouseStop(event);
|
127
|
-
}
|
128
|
-
|
129
|
-
return false;
|
130
|
-
},
|
131
|
-
|
132
|
-
_mouseDistanceMet: function(event) {
|
133
|
-
return (Math.max(
|
134
|
-
Math.abs(this._mouseDownEvent.pageX - event.pageX),
|
135
|
-
Math.abs(this._mouseDownEvent.pageY - event.pageY)
|
136
|
-
) >= this.options.distance
|
137
|
-
);
|
138
|
-
},
|
139
|
-
|
140
|
-
_mouseDelayMet: function(event) {
|
141
|
-
return this.mouseDelayMet;
|
142
|
-
},
|
143
|
-
|
144
|
-
// These are placeholder methods, to be overriden by extending plugin
|
145
|
-
_mouseStart: function(event) {},
|
146
|
-
_mouseDrag: function(event) {},
|
147
|
-
_mouseStop: function(event) {},
|
148
|
-
_mouseCapture: function(event) { return true; }
|
149
|
-
});
|
150
|
-
|
151
|
-
})(jQuery);
|
@@ -1,233 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery UI Position 1.8.4
|
3
|
-
*
|
4
|
-
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
|
5
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6
|
-
* http://jquery.org/license
|
7
|
-
*
|
8
|
-
* http://docs.jquery.com/UI/Position
|
9
|
-
*/
|
10
|
-
(function( $, undefined ) {
|
11
|
-
|
12
|
-
$.ui = $.ui || {};
|
13
|
-
|
14
|
-
var horizontalPositions = /left|center|right/,
|
15
|
-
horizontalDefault = "center",
|
16
|
-
verticalPositions = /top|center|bottom/,
|
17
|
-
verticalDefault = "center",
|
18
|
-
_position = $.fn.position,
|
19
|
-
_offset = $.fn.offset;
|
20
|
-
|
21
|
-
$.fn.position = function( options ) {
|
22
|
-
if ( !options || !options.of ) {
|
23
|
-
return _position.apply( this, arguments );
|
24
|
-
}
|
25
|
-
|
26
|
-
// make a copy, we don't want to modify arguments
|
27
|
-
options = $.extend( {}, options );
|
28
|
-
|
29
|
-
var target = $( options.of ),
|
30
|
-
collision = ( options.collision || "flip" ).split( " " ),
|
31
|
-
offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ],
|
32
|
-
targetWidth,
|
33
|
-
targetHeight,
|
34
|
-
basePosition;
|
35
|
-
|
36
|
-
if ( options.of.nodeType === 9 ) {
|
37
|
-
targetWidth = target.width();
|
38
|
-
targetHeight = target.height();
|
39
|
-
basePosition = { top: 0, left: 0 };
|
40
|
-
} else if ( options.of.scrollTo && options.of.document ) {
|
41
|
-
targetWidth = target.width();
|
42
|
-
targetHeight = target.height();
|
43
|
-
basePosition = { top: target.scrollTop(), left: target.scrollLeft() };
|
44
|
-
} else if ( options.of.preventDefault ) {
|
45
|
-
// force left top to allow flipping
|
46
|
-
options.at = "left top";
|
47
|
-
targetWidth = targetHeight = 0;
|
48
|
-
basePosition = { top: options.of.pageY, left: options.of.pageX };
|
49
|
-
} else {
|
50
|
-
targetWidth = target.outerWidth();
|
51
|
-
targetHeight = target.outerHeight();
|
52
|
-
basePosition = target.offset();
|
53
|
-
}
|
54
|
-
|
55
|
-
// force my and at to have valid horizontal and veritcal positions
|
56
|
-
// if a value is missing or invalid, it will be converted to center
|
57
|
-
$.each( [ "my", "at" ], function() {
|
58
|
-
var pos = ( options[this] || "" ).split( " " );
|
59
|
-
if ( pos.length === 1) {
|
60
|
-
pos = horizontalPositions.test( pos[0] ) ?
|
61
|
-
pos.concat( [verticalDefault] ) :
|
62
|
-
verticalPositions.test( pos[0] ) ?
|
63
|
-
[ horizontalDefault ].concat( pos ) :
|
64
|
-
[ horizontalDefault, verticalDefault ];
|
65
|
-
}
|
66
|
-
pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : horizontalDefault;
|
67
|
-
pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : verticalDefault;
|
68
|
-
options[ this ] = pos;
|
69
|
-
});
|
70
|
-
|
71
|
-
// normalize collision option
|
72
|
-
if ( collision.length === 1 ) {
|
73
|
-
collision[ 1 ] = collision[ 0 ];
|
74
|
-
}
|
75
|
-
|
76
|
-
// normalize offset option
|
77
|
-
offset[ 0 ] = parseInt( offset[0], 10 ) || 0;
|
78
|
-
if ( offset.length === 1 ) {
|
79
|
-
offset[ 1 ] = offset[ 0 ];
|
80
|
-
}
|
81
|
-
offset[ 1 ] = parseInt( offset[1], 10 ) || 0;
|
82
|
-
|
83
|
-
if ( options.at[0] === "right" ) {
|
84
|
-
basePosition.left += targetWidth;
|
85
|
-
} else if (options.at[0] === horizontalDefault ) {
|
86
|
-
basePosition.left += targetWidth / 2;
|
87
|
-
}
|
88
|
-
|
89
|
-
if ( options.at[1] === "bottom" ) {
|
90
|
-
basePosition.top += targetHeight;
|
91
|
-
} else if ( options.at[1] === verticalDefault ) {
|
92
|
-
basePosition.top += targetHeight / 2;
|
93
|
-
}
|
94
|
-
|
95
|
-
basePosition.left += offset[ 0 ];
|
96
|
-
basePosition.top += offset[ 1 ];
|
97
|
-
|
98
|
-
return this.each(function() {
|
99
|
-
var elem = $( this ),
|
100
|
-
elemWidth = elem.outerWidth(),
|
101
|
-
elemHeight = elem.outerHeight(),
|
102
|
-
position = $.extend( {}, basePosition );
|
103
|
-
|
104
|
-
if ( options.my[0] === "right" ) {
|
105
|
-
position.left -= elemWidth;
|
106
|
-
} else if ( options.my[0] === horizontalDefault ) {
|
107
|
-
position.left -= elemWidth / 2;
|
108
|
-
}
|
109
|
-
|
110
|
-
if ( options.my[1] === "bottom" ) {
|
111
|
-
position.top -= elemHeight;
|
112
|
-
} else if ( options.my[1] === verticalDefault ) {
|
113
|
-
position.top -= elemHeight / 2;
|
114
|
-
}
|
115
|
-
|
116
|
-
// prevent fractions (see #5280)
|
117
|
-
position.left = parseInt( position.left );
|
118
|
-
position.top = parseInt( position.top );
|
119
|
-
|
120
|
-
$.each( [ "left", "top" ], function( i, dir ) {
|
121
|
-
if ( $.ui.position[ collision[i] ] ) {
|
122
|
-
$.ui.position[ collision[i] ][ dir ]( position, {
|
123
|
-
targetWidth: targetWidth,
|
124
|
-
targetHeight: targetHeight,
|
125
|
-
elemWidth: elemWidth,
|
126
|
-
elemHeight: elemHeight,
|
127
|
-
offset: offset,
|
128
|
-
my: options.my,
|
129
|
-
at: options.at
|
130
|
-
});
|
131
|
-
}
|
132
|
-
});
|
133
|
-
|
134
|
-
if ( $.fn.bgiframe ) {
|
135
|
-
elem.bgiframe();
|
136
|
-
}
|
137
|
-
elem.offset( $.extend( position, { using: options.using } ) );
|
138
|
-
});
|
139
|
-
};
|
140
|
-
|
141
|
-
$.ui.position = {
|
142
|
-
fit: {
|
143
|
-
left: function( position, data ) {
|
144
|
-
var win = $( window ),
|
145
|
-
over = position.left + data.elemWidth - win.width() - win.scrollLeft();
|
146
|
-
position.left = over > 0 ? position.left - over : Math.max( 0, position.left );
|
147
|
-
},
|
148
|
-
top: function( position, data ) {
|
149
|
-
var win = $( window ),
|
150
|
-
over = position.top + data.elemHeight - win.height() - win.scrollTop();
|
151
|
-
position.top = over > 0 ? position.top - over : Math.max( 0, position.top );
|
152
|
-
}
|
153
|
-
},
|
154
|
-
|
155
|
-
flip: {
|
156
|
-
left: function( position, data ) {
|
157
|
-
if ( data.at[0] === "center" ) {
|
158
|
-
return;
|
159
|
-
}
|
160
|
-
var win = $( window ),
|
161
|
-
over = position.left + data.elemWidth - win.width() - win.scrollLeft(),
|
162
|
-
myOffset = data.my[ 0 ] === "left" ?
|
163
|
-
-data.elemWidth :
|
164
|
-
data.my[ 0 ] === "right" ?
|
165
|
-
data.elemWidth :
|
166
|
-
0,
|
167
|
-
offset = -2 * data.offset[ 0 ];
|
168
|
-
position.left += position.left < 0 ?
|
169
|
-
myOffset + data.targetWidth + offset :
|
170
|
-
over > 0 ?
|
171
|
-
myOffset - data.targetWidth + offset :
|
172
|
-
0;
|
173
|
-
},
|
174
|
-
top: function( position, data ) {
|
175
|
-
if ( data.at[1] === "center" ) {
|
176
|
-
return;
|
177
|
-
}
|
178
|
-
var win = $( window ),
|
179
|
-
over = position.top + data.elemHeight - win.height() - win.scrollTop(),
|
180
|
-
myOffset = data.my[ 1 ] === "top" ?
|
181
|
-
-data.elemHeight :
|
182
|
-
data.my[ 1 ] === "bottom" ?
|
183
|
-
data.elemHeight :
|
184
|
-
0,
|
185
|
-
atOffset = data.at[ 1 ] === "top" ?
|
186
|
-
data.targetHeight :
|
187
|
-
-data.targetHeight,
|
188
|
-
offset = -2 * data.offset[ 1 ];
|
189
|
-
position.top += position.top < 0 ?
|
190
|
-
myOffset + data.targetHeight + offset :
|
191
|
-
over > 0 ?
|
192
|
-
myOffset + atOffset + offset :
|
193
|
-
0;
|
194
|
-
}
|
195
|
-
}
|
196
|
-
};
|
197
|
-
|
198
|
-
// offset setter from jQuery 1.4
|
199
|
-
if ( !$.offset.setOffset ) {
|
200
|
-
$.offset.setOffset = function( elem, options ) {
|
201
|
-
// set position first, in-case top/left are set even on static elem
|
202
|
-
if ( /static/.test( $.curCSS( elem, "position" ) ) ) {
|
203
|
-
elem.style.position = "relative";
|
204
|
-
}
|
205
|
-
var curElem = $( elem ),
|
206
|
-
curOffset = curElem.offset(),
|
207
|
-
curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0,
|
208
|
-
curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0,
|
209
|
-
props = {
|
210
|
-
top: (options.top - curOffset.top) + curTop,
|
211
|
-
left: (options.left - curOffset.left) + curLeft
|
212
|
-
};
|
213
|
-
|
214
|
-
if ( 'using' in options ) {
|
215
|
-
options.using.call( elem, props );
|
216
|
-
} else {
|
217
|
-
curElem.css( props );
|
218
|
-
}
|
219
|
-
};
|
220
|
-
|
221
|
-
$.fn.offset = function( options ) {
|
222
|
-
var elem = this[ 0 ];
|
223
|
-
if ( !elem || !elem.ownerDocument ) { return null; }
|
224
|
-
if ( options ) {
|
225
|
-
return this.each(function() {
|
226
|
-
$.offset.setOffset( this, options );
|
227
|
-
});
|
228
|
-
}
|
229
|
-
return _offset.call( this );
|
230
|
-
};
|
231
|
-
}
|
232
|
-
|
233
|
-
}( jQuery ));
|