jquery-ui-rails 5.0.4 → 7.0.0
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.
- checksums.yaml +7 -0
- data/.gitmodules +1 -1
- data/.travis.yml +1 -1
- data/History.md +23 -2
- data/README.md +67 -50
- data/Rakefile +58 -29
- data/VERSIONS.md +4 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_444444_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_555555_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_777620_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_777777_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_cc0000_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
- data/app/assets/javascripts/jquery-ui/core.js +15 -304
- data/app/assets/javascripts/jquery-ui/data.js +45 -0
- data/app/assets/javascripts/jquery-ui/disable-selection.js +51 -0
- data/app/assets/javascripts/jquery-ui/effect.all.js +15 -16
- data/app/assets/javascripts/jquery-ui/effect.js +565 -891
- data/app/assets/javascripts/jquery-ui/effects/effect-blind.js +76 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-bounce.js +116 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-clip.js +71 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-drop.js +75 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-explode.js +117 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-fade.js +53 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-fold.js +95 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-highlight.js +63 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-puff.js +49 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-pulsate.js +70 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-scale.js +63 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-shake.js +80 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-size.js +199 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-slide.js +82 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-transfer.js +46 -0
- data/app/assets/javascripts/jquery-ui/focusable.js +89 -0
- data/app/assets/javascripts/jquery-ui/form-reset-mixin.js +83 -0
- data/app/assets/javascripts/jquery-ui/form.js +25 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-af.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ar-DZ.js +42 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ar.js +42 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-az.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-be.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-bg.js +41 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-bs.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ca.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-cs.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-cy-GB.js +48 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-da.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-de-AT.js +41 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-de.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-el.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-AU.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-GB.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-NZ.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-eo.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-es.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-et.js +48 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-eu.js +39 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-fa.js +76 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-fi.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-fo.js +48 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr-CA.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr-CH.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr.js +42 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-gl.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-he.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-hi.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-hr.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-hu.js +39 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-hy.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-id.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-is.js +48 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-it-CH.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-it.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ja.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ka.js +51 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-kk.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-km.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ko.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ky.js +41 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-lb.js +48 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-lt.js +48 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-lv.js +48 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-mk.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ml.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ms.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-nb.js +52 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-nl-BE.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-nl.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-nn.js +52 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-no.js +53 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-pl.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-pt-BR.js +48 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-pt.js +47 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-rm.js +64 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ro.js +43 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ru.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-sk.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-sl.js +41 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-sq.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-sr-SR.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-sr.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-sv.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ta.js +56 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-th.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-tj.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-tr.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-uk.js +41 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-vi.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-CN.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-HK.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-TW.js +40 -0
- data/app/assets/javascripts/jquery-ui/ie.js +20 -0
- data/app/assets/javascripts/jquery-ui/jquery-patch.js +91 -0
- data/app/assets/javascripts/jquery-ui/jquery-var-for-color.js +24 -0
- data/app/assets/javascripts/jquery-ui/keycode.js +51 -0
- data/app/assets/javascripts/jquery-ui/labels.js +71 -0
- data/app/assets/javascripts/jquery-ui/plugin.js +49 -0
- data/app/assets/javascripts/jquery-ui/position.js +107 -111
- data/app/assets/javascripts/jquery-ui/safe-active-element.js +46 -0
- data/app/assets/javascripts/jquery-ui/safe-blur.js +27 -0
- data/app/assets/javascripts/jquery-ui/scroll-parent.js +50 -0
- data/app/assets/javascripts/jquery-ui/tabbable.js +41 -0
- data/app/assets/javascripts/jquery-ui/unique-id.js +54 -0
- data/app/assets/javascripts/jquery-ui/vendor/jquery-color/jquery.color.js +722 -0
- data/app/assets/javascripts/jquery-ui/version.js +20 -0
- data/app/assets/javascripts/jquery-ui/widget.js +359 -163
- data/app/assets/javascripts/jquery-ui/{accordion.js → widgets/accordion.js} +200 -163
- data/app/assets/javascripts/jquery-ui/{autocomplete.js → widgets/autocomplete.js} +153 -106
- data/app/assets/javascripts/jquery-ui/widgets/button.js +454 -0
- data/app/assets/javascripts/jquery-ui/widgets/checkboxradio.js +289 -0
- data/app/assets/javascripts/jquery-ui/widgets/controlgroup.js +304 -0
- data/app/assets/javascripts/jquery-ui/widgets/datepicker.js +2243 -0
- data/app/assets/javascripts/jquery-ui/{dialog.js → widgets/dialog.js} +267 -181
- data/app/assets/javascripts/jquery-ui/{draggable.js → widgets/draggable.js} +430 -294
- data/app/assets/javascripts/jquery-ui/{droppable.js → widgets/droppable.js} +174 -84
- data/app/assets/javascripts/jquery-ui/{menu.js → widgets/menu.js} +228 -158
- data/app/assets/javascripts/jquery-ui/widgets/mouse.js +241 -0
- data/app/assets/javascripts/jquery-ui/{progressbar.js → widgets/progressbar.js} +63 -41
- data/app/assets/javascripts/jquery-ui/widgets/resizable.js +1225 -0
- data/app/assets/javascripts/jquery-ui/widgets/selectable.js +321 -0
- data/app/assets/javascripts/jquery-ui/{selectmenu.js → widgets/selectmenu.js} +259 -177
- data/app/assets/javascripts/jquery-ui/{slider.js → widgets/slider.js} +199 -160
- data/app/assets/javascripts/jquery-ui/widgets/sortable.js +1623 -0
- data/app/assets/javascripts/jquery-ui/{spinner.js → widgets/spinner.js} +184 -114
- data/app/assets/javascripts/jquery-ui/{tabs.js → widgets/tabs.js} +258 -211
- data/app/assets/javascripts/jquery-ui/{tooltip.js → widgets/tooltip.js} +165 -100
- data/app/assets/javascripts/jquery-ui.js +53 -33
- data/app/assets/stylesheets/jquery-ui/accordion.css +1 -15
- data/app/assets/stylesheets/jquery-ui/all.css +1 -1
- data/app/assets/stylesheets/jquery-ui/autocomplete.css +1 -3
- data/app/assets/stylesheets/jquery-ui/base.css +3 -1
- data/app/assets/stylesheets/jquery-ui/button.css +35 -68
- data/app/assets/stylesheets/jquery-ui/checkboxradio.css +37 -0
- data/app/assets/stylesheets/jquery-ui/controlgroup.css +68 -0
- data/app/assets/stylesheets/jquery-ui/core.css +12 -8
- data/app/assets/stylesheets/jquery-ui/datepicker.css +11 -2
- data/app/assets/stylesheets/jquery-ui/dialog.css +38 -11
- data/app/assets/stylesheets/jquery-ui/draggable.css +1 -2
- data/app/assets/stylesheets/jquery-ui/menu.css +7 -7
- data/app/assets/stylesheets/jquery-ui/progressbar.css +2 -3
- data/app/assets/stylesheets/jquery-ui/resizable.css +1 -2
- data/app/assets/stylesheets/jquery-ui/selectable.css +1 -2
- data/app/assets/stylesheets/jquery-ui/selectmenu.css +11 -22
- data/app/assets/stylesheets/jquery-ui/slider.css +2 -3
- data/app/assets/stylesheets/jquery-ui/sortable.css +1 -2
- data/app/assets/stylesheets/jquery-ui/spinner.css +7 -22
- data/app/assets/stylesheets/jquery-ui/tabs.css +1 -2
- data/app/assets/stylesheets/jquery-ui/theme.css.erb +121 -92
- data/app/assets/stylesheets/jquery-ui/tooltip.css +1 -4
- data/lib/jquery/ui/rails/version.rb +2 -2
- metadata +153 -146
- data/app/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_888888_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/javascripts/jquery-ui/button.js +0 -414
- data/app/assets/javascripts/jquery-ui/datepicker-af.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ar-DZ.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ar.js +0 -38
- data/app/assets/javascripts/jquery-ui/datepicker-az.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-be.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-bg.js +0 -38
- data/app/assets/javascripts/jquery-ui/datepicker-bs.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ca.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-cs.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-cy-GB.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-da.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-de.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-el.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-en-AU.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-en-GB.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-en-NZ.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-eo.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-es.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-et.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-eu.js +0 -36
- data/app/assets/javascripts/jquery-ui/datepicker-fa.js +0 -73
- data/app/assets/javascripts/jquery-ui/datepicker-fi.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-fo.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-fr-CA.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-fr-CH.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-fr.js +0 -39
- data/app/assets/javascripts/jquery-ui/datepicker-gl.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-he.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-hi.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-hr.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-hu.js +0 -36
- data/app/assets/javascripts/jquery-ui/datepicker-hy.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-id.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-is.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-it-CH.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-it.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ja.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ka.js +0 -35
- data/app/assets/javascripts/jquery-ui/datepicker-kk.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-km.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ko.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ky.js +0 -38
- data/app/assets/javascripts/jquery-ui/datepicker-lb.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-lt.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-lv.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-mk.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ml.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ms.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-nb.js +0 -36
- data/app/assets/javascripts/jquery-ui/datepicker-nl-BE.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-nl.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-nn.js +0 -36
- data/app/assets/javascripts/jquery-ui/datepicker-no.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-pl.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-pt-BR.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-pt.js +0 -36
- data/app/assets/javascripts/jquery-ui/datepicker-rm.js +0 -35
- data/app/assets/javascripts/jquery-ui/datepicker-ro.js +0 -40
- data/app/assets/javascripts/jquery-ui/datepicker-ru.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-sk.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-sl.js +0 -38
- data/app/assets/javascripts/jquery-ui/datepicker-sq.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-sr-SR.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-sr.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-sv.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ta.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-th.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-tj.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-tr.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-uk.js +0 -38
- data/app/assets/javascripts/jquery-ui/datepicker-vi.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-zh-CN.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-zh-HK.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-zh-TW.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker.js +0 -2086
- data/app/assets/javascripts/jquery-ui/effect-blind.js +0 -92
- data/app/assets/javascripts/jquery-ui/effect-bounce.js +0 -125
- data/app/assets/javascripts/jquery-ui/effect-clip.js +0 -79
- data/app/assets/javascripts/jquery-ui/effect-drop.js +0 -77
- data/app/assets/javascripts/jquery-ui/effect-explode.js +0 -109
- data/app/assets/javascripts/jquery-ui/effect-fade.js +0 -42
- data/app/assets/javascripts/jquery-ui/effect-fold.js +0 -88
- data/app/assets/javascripts/jquery-ui/effect-highlight.js +0 -62
- data/app/assets/javascripts/jquery-ui/effect-puff.js +0 -63
- data/app/assets/javascripts/jquery-ui/effect-pulsate.js +0 -75
- data/app/assets/javascripts/jquery-ui/effect-scale.js +0 -92
- data/app/assets/javascripts/jquery-ui/effect-shake.js +0 -86
- data/app/assets/javascripts/jquery-ui/effect-size.js +0 -235
- data/app/assets/javascripts/jquery-ui/effect-slide.js +0 -76
- data/app/assets/javascripts/jquery-ui/effect-transfer.js +0 -59
- data/app/assets/javascripts/jquery-ui/mouse.js +0 -202
- data/app/assets/javascripts/jquery-ui/resizable.js +0 -1183
- data/app/assets/javascripts/jquery-ui/selectable.js +0 -291
- data/app/assets/javascripts/jquery-ui/sortable.js +0 -1308
@@ -1,36 +1,55 @@
|
|
1
|
-
//= require jquery-ui/
|
1
|
+
//= require jquery-ui/widgets/mouse
|
2
|
+
//= require jquery-ui/data
|
3
|
+
//= require jquery-ui/plugin
|
4
|
+
//= require jquery-ui/safe-active-element
|
5
|
+
//= require jquery-ui/safe-blur
|
6
|
+
//= require jquery-ui/scroll-parent
|
7
|
+
//= require jquery-ui/version
|
2
8
|
//= require jquery-ui/widget
|
3
|
-
//= require jquery-ui/mouse
|
4
9
|
|
5
10
|
/*!
|
6
|
-
* jQuery UI Draggable 1.
|
11
|
+
* jQuery UI Draggable 1.13.0
|
7
12
|
* http://jqueryui.com
|
8
13
|
*
|
9
14
|
* Copyright jQuery Foundation and other contributors
|
10
15
|
* Released under the MIT license.
|
11
16
|
* http://jquery.org/license
|
12
|
-
*
|
13
|
-
* http://api.jqueryui.com/draggable/
|
14
17
|
*/
|
15
|
-
|
18
|
+
|
19
|
+
//>>label: Draggable
|
20
|
+
//>>group: Interactions
|
21
|
+
//>>description: Enables dragging functionality for any element.
|
22
|
+
//>>docs: http://api.jqueryui.com/draggable/
|
23
|
+
//>>demos: http://jqueryui.com/draggable/
|
24
|
+
//>>css.structure: ../../themes/base/draggable.css
|
25
|
+
|
26
|
+
( function( factory ) {
|
27
|
+
"use strict";
|
28
|
+
|
16
29
|
if ( typeof define === "function" && define.amd ) {
|
17
30
|
|
18
31
|
// AMD. Register as an anonymous module.
|
19
|
-
define([
|
32
|
+
define( [
|
20
33
|
"jquery",
|
21
|
-
"./core",
|
22
34
|
"./mouse",
|
23
|
-
"
|
35
|
+
"../data",
|
36
|
+
"../plugin",
|
37
|
+
"../safe-active-element",
|
38
|
+
"../safe-blur",
|
39
|
+
"../scroll-parent",
|
40
|
+
"../version",
|
41
|
+
"../widget"
|
24
42
|
], factory );
|
25
43
|
} else {
|
26
44
|
|
27
45
|
// Browser globals
|
28
46
|
factory( jQuery );
|
29
47
|
}
|
30
|
-
}(function( $ ) {
|
48
|
+
} )( function( $ ) {
|
49
|
+
"use strict";
|
31
50
|
|
32
|
-
$.widget("ui.draggable", $.ui.mouse, {
|
33
|
-
version: "1.
|
51
|
+
$.widget( "ui.draggable", $.ui.mouse, {
|
52
|
+
version: "1.13.0",
|
34
53
|
widgetEventPrefix: "drag",
|
35
54
|
options: {
|
36
55
|
addClasses: true,
|
@@ -58,7 +77,7 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
58
77
|
stack: false,
|
59
78
|
zIndex: false,
|
60
79
|
|
61
|
-
//
|
80
|
+
// Callbacks
|
62
81
|
drag: null,
|
63
82
|
start: null,
|
64
83
|
stop: null
|
@@ -68,11 +87,8 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
68
87
|
if ( this.options.helper === "original" ) {
|
69
88
|
this._setPositionRelative();
|
70
89
|
}
|
71
|
-
if (this.options.addClasses){
|
72
|
-
this.
|
73
|
-
}
|
74
|
-
if (this.options.disabled){
|
75
|
-
this.element.addClass("ui-draggable-disabled");
|
90
|
+
if ( this.options.addClasses ) {
|
91
|
+
this._addClass( "ui-draggable" );
|
76
92
|
}
|
77
93
|
this._setHandleClassName();
|
78
94
|
|
@@ -92,27 +108,27 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
92
108
|
this.destroyOnClear = true;
|
93
109
|
return;
|
94
110
|
}
|
95
|
-
this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
|
96
111
|
this._removeHandleClassName();
|
97
112
|
this._mouseDestroy();
|
98
113
|
},
|
99
114
|
|
100
|
-
_mouseCapture: function(event) {
|
115
|
+
_mouseCapture: function( event ) {
|
101
116
|
var o = this.options;
|
102
117
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
|
118
|
+
// Among others, prevent a drag on a resizable-handle
|
119
|
+
if ( this.helper || o.disabled ||
|
120
|
+
$( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) {
|
107
121
|
return false;
|
108
122
|
}
|
109
123
|
|
110
124
|
//Quit if we're not on a valid handle
|
111
|
-
this.handle = this._getHandle(event);
|
112
|
-
if (!this.handle) {
|
125
|
+
this.handle = this._getHandle( event );
|
126
|
+
if ( !this.handle ) {
|
113
127
|
return false;
|
114
128
|
}
|
115
129
|
|
130
|
+
this._blurActiveElement( event );
|
131
|
+
|
116
132
|
this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
|
117
133
|
|
118
134
|
return true;
|
@@ -120,7 +136,7 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
120
136
|
},
|
121
137
|
|
122
138
|
_blockFrames: function( selector ) {
|
123
|
-
this.iframeBlocks = this.document.find( selector ).map(function() {
|
139
|
+
this.iframeBlocks = this.document.find( selector ).map( function() {
|
124
140
|
var iframe = $( this );
|
125
141
|
|
126
142
|
return $( "<div>" )
|
@@ -129,7 +145,7 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
129
145
|
.outerWidth( iframe.outerWidth() )
|
130
146
|
.outerHeight( iframe.outerHeight() )
|
131
147
|
.offset( iframe.offset() )[ 0 ];
|
132
|
-
});
|
148
|
+
} );
|
133
149
|
},
|
134
150
|
|
135
151
|
_unblockFrames: function() {
|
@@ -140,41 +156,34 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
140
156
|
},
|
141
157
|
|
142
158
|
_blurActiveElement: function( event ) {
|
143
|
-
var
|
159
|
+
var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
|
160
|
+
target = $( event.target );
|
144
161
|
|
145
|
-
//
|
146
|
-
|
162
|
+
// Don't blur if the event occurred on an element that is within
|
163
|
+
// the currently focused element
|
164
|
+
// See #10527, #12472
|
165
|
+
if ( target.closest( activeElement ).length ) {
|
147
166
|
return;
|
148
167
|
}
|
149
168
|
|
150
|
-
//
|
151
|
-
|
152
|
-
try {
|
153
|
-
|
154
|
-
// Support: IE9, IE10
|
155
|
-
// If the <body> is blurred, IE will switch windows, see #9520
|
156
|
-
if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
|
157
|
-
|
158
|
-
// Blur any element that currently has focus, see #4261
|
159
|
-
$( document.activeElement ).blur();
|
160
|
-
}
|
161
|
-
} catch ( error ) {}
|
169
|
+
// Blur any element that currently has focus, see #4261
|
170
|
+
$.ui.safeBlur( activeElement );
|
162
171
|
},
|
163
172
|
|
164
|
-
_mouseStart: function(event) {
|
173
|
+
_mouseStart: function( event ) {
|
165
174
|
|
166
175
|
var o = this.options;
|
167
176
|
|
168
177
|
//Create and append the visible helper
|
169
|
-
this.helper = this._createHelper(event);
|
178
|
+
this.helper = this._createHelper( event );
|
170
179
|
|
171
|
-
this.helper
|
180
|
+
this._addClass( this.helper, "ui-draggable-dragging" );
|
172
181
|
|
173
182
|
//Cache the helper size
|
174
183
|
this._cacheHelperProportions();
|
175
184
|
|
176
185
|
//If ddmanager is used for droppables, set the global draggable
|
177
|
-
if ($.ui.ddmanager) {
|
186
|
+
if ( $.ui.ddmanager ) {
|
178
187
|
$.ui.ddmanager.current = this;
|
179
188
|
}
|
180
189
|
|
@@ -190,9 +199,9 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
190
199
|
this.cssPosition = this.helper.css( "position" );
|
191
200
|
this.scrollParent = this.helper.scrollParent( true );
|
192
201
|
this.offsetParent = this.helper.offsetParent();
|
193
|
-
this.hasFixedAncestor = this.helper.parents().filter(function() {
|
202
|
+
this.hasFixedAncestor = this.helper.parents().filter( function() {
|
194
203
|
return $( this ).css( "position" ) === "fixed";
|
195
|
-
}).length > 0;
|
204
|
+
} ).length > 0;
|
196
205
|
|
197
206
|
//The element's absolute position on the page minus margins
|
198
207
|
this.positionAbs = this.element.offset();
|
@@ -204,13 +213,15 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
204
213
|
this.originalPageY = event.pageY;
|
205
214
|
|
206
215
|
//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
|
207
|
-
(o.cursorAt
|
216
|
+
if ( o.cursorAt ) {
|
217
|
+
this._adjustOffsetFromHelper( o.cursorAt );
|
218
|
+
}
|
208
219
|
|
209
220
|
//Set a containment if given in the options
|
210
221
|
this._setContainment();
|
211
222
|
|
212
223
|
//Trigger event + callbacks
|
213
|
-
if (this._trigger("start", event) === false) {
|
224
|
+
if ( this._trigger( "start", event ) === false ) {
|
214
225
|
this._clear();
|
215
226
|
return false;
|
216
227
|
}
|
@@ -219,19 +230,18 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
219
230
|
this._cacheHelperProportions();
|
220
231
|
|
221
232
|
//Prepare the droppable offsets
|
222
|
-
if ($.ui.ddmanager && !o.dropBehaviour) {
|
223
|
-
$.ui.ddmanager.prepareOffsets(this, event);
|
233
|
+
if ( $.ui.ddmanager && !o.dropBehaviour ) {
|
234
|
+
$.ui.ddmanager.prepareOffsets( this, event );
|
224
235
|
}
|
225
236
|
|
226
|
-
//
|
227
|
-
//
|
228
|
-
this.
|
237
|
+
// Execute the drag once - this causes the helper not to be visible before getting its
|
238
|
+
// correct position
|
239
|
+
this._mouseDrag( event, true );
|
229
240
|
|
230
|
-
|
231
|
-
|
232
|
-
//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
|
241
|
+
// If the ddmanager is used for droppables, inform the manager that dragging has started
|
242
|
+
// (see #5003)
|
233
243
|
if ( $.ui.ddmanager ) {
|
234
|
-
$.ui.ddmanager.dragStart(this, event);
|
244
|
+
$.ui.ddmanager.dragStart( this, event );
|
235
245
|
}
|
236
246
|
|
237
247
|
return true;
|
@@ -252,7 +262,8 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
252
262
|
};
|
253
263
|
},
|
254
264
|
|
255
|
-
_mouseDrag: function(event, noPropagation) {
|
265
|
+
_mouseDrag: function( event, noPropagation ) {
|
266
|
+
|
256
267
|
// reset any necessary cached properties (see #5009)
|
257
268
|
if ( this.hasFixedAncestor ) {
|
258
269
|
this.offset.parent = this._getParentOffset();
|
@@ -260,13 +271,13 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
260
271
|
|
261
272
|
//Compute the helpers position
|
262
273
|
this.position = this._generatePosition( event, true );
|
263
|
-
this.positionAbs = this._convertPositionTo("absolute");
|
274
|
+
this.positionAbs = this._convertPositionTo( "absolute" );
|
264
275
|
|
265
276
|
//Call plugins and callbacks and use the resulting position if something is returned
|
266
|
-
if (!noPropagation) {
|
277
|
+
if ( !noPropagation ) {
|
267
278
|
var ui = this._uiHash();
|
268
|
-
if (this._trigger("drag", event, ui) === false) {
|
269
|
-
this._mouseUp(
|
279
|
+
if ( this._trigger( "drag", event, ui ) === false ) {
|
280
|
+
this._mouseUp( new $.Event( "mouseup", event ) );
|
270
281
|
return false;
|
271
282
|
}
|
272
283
|
this.position = ui.position;
|
@@ -275,36 +286,44 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
275
286
|
this.helper[ 0 ].style.left = this.position.left + "px";
|
276
287
|
this.helper[ 0 ].style.top = this.position.top + "px";
|
277
288
|
|
278
|
-
if ($.ui.ddmanager) {
|
279
|
-
$.ui.ddmanager.drag(this, event);
|
289
|
+
if ( $.ui.ddmanager ) {
|
290
|
+
$.ui.ddmanager.drag( this, event );
|
280
291
|
}
|
281
292
|
|
282
293
|
return false;
|
283
294
|
},
|
284
295
|
|
285
|
-
_mouseStop: function(event) {
|
296
|
+
_mouseStop: function( event ) {
|
286
297
|
|
287
298
|
//If we are using droppables, inform the manager about the drop
|
288
299
|
var that = this,
|
289
300
|
dropped = false;
|
290
|
-
if ($.ui.ddmanager && !this.options.dropBehaviour) {
|
291
|
-
dropped = $.ui.ddmanager.drop(this, event);
|
301
|
+
if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
|
302
|
+
dropped = $.ui.ddmanager.drop( this, event );
|
292
303
|
}
|
293
304
|
|
294
305
|
//if a drop comes from outside (a sortable)
|
295
|
-
if (this.dropped) {
|
306
|
+
if ( this.dropped ) {
|
296
307
|
dropped = this.dropped;
|
297
308
|
this.dropped = false;
|
298
309
|
}
|
299
310
|
|
300
|
-
if ((this.options.revert === "invalid" && !dropped
|
301
|
-
|
302
|
-
|
303
|
-
|
311
|
+
if ( ( this.options.revert === "invalid" && !dropped ) ||
|
312
|
+
( this.options.revert === "valid" && dropped ) ||
|
313
|
+
this.options.revert === true || ( typeof this.options.revert === "function" &&
|
314
|
+
this.options.revert.call( this.element, dropped ) )
|
315
|
+
) {
|
316
|
+
$( this.helper ).animate(
|
317
|
+
this.originalPosition,
|
318
|
+
parseInt( this.options.revertDuration, 10 ),
|
319
|
+
function() {
|
320
|
+
if ( that._trigger( "stop", event ) !== false ) {
|
321
|
+
that._clear();
|
322
|
+
}
|
304
323
|
}
|
305
|
-
|
324
|
+
);
|
306
325
|
} else {
|
307
|
-
if (this._trigger("stop", event) !== false) {
|
326
|
+
if ( this._trigger( "stop", event ) !== false ) {
|
308
327
|
this._clear();
|
309
328
|
}
|
310
329
|
}
|
@@ -315,24 +334,27 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
315
334
|
_mouseUp: function( event ) {
|
316
335
|
this._unblockFrames();
|
317
336
|
|
318
|
-
//If the ddmanager is used for droppables, inform the manager that dragging has stopped
|
337
|
+
// If the ddmanager is used for droppables, inform the manager that dragging has stopped
|
338
|
+
// (see #5003)
|
319
339
|
if ( $.ui.ddmanager ) {
|
320
|
-
$.ui.ddmanager.dragStop(this, event);
|
340
|
+
$.ui.ddmanager.dragStop( this, event );
|
321
341
|
}
|
322
342
|
|
323
343
|
// Only need to focus if the event occurred on the draggable itself, see #10527
|
324
344
|
if ( this.handleElement.is( event.target ) ) {
|
325
|
-
|
326
|
-
|
345
|
+
|
346
|
+
// The interaction is over; whether or not the click resulted in a drag,
|
347
|
+
// focus the element
|
348
|
+
this.element.trigger( "focus" );
|
327
349
|
}
|
328
350
|
|
329
|
-
return $.ui.mouse.prototype._mouseUp.call(this, event);
|
351
|
+
return $.ui.mouse.prototype._mouseUp.call( this, event );
|
330
352
|
},
|
331
353
|
|
332
354
|
cancel: function() {
|
333
355
|
|
334
|
-
if (this.helper.is(".ui-draggable-dragging")) {
|
335
|
-
this._mouseUp({});
|
356
|
+
if ( this.helper.is( ".ui-draggable-dragging" ) ) {
|
357
|
+
this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) );
|
336
358
|
} else {
|
337
359
|
this._clear();
|
338
360
|
}
|
@@ -341,7 +363,7 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
341
363
|
|
342
364
|
},
|
343
365
|
|
344
|
-
_getHandle: function(event) {
|
366
|
+
_getHandle: function( event ) {
|
345
367
|
return this.options.handle ?
|
346
368
|
!!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
|
347
369
|
true;
|
@@ -350,36 +372,39 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
350
372
|
_setHandleClassName: function() {
|
351
373
|
this.handleElement = this.options.handle ?
|
352
374
|
this.element.find( this.options.handle ) : this.element;
|
353
|
-
this.
|
375
|
+
this._addClass( this.handleElement, "ui-draggable-handle" );
|
354
376
|
},
|
355
377
|
|
356
378
|
_removeHandleClassName: function() {
|
357
|
-
this.
|
379
|
+
this._removeClass( this.handleElement, "ui-draggable-handle" );
|
358
380
|
},
|
359
381
|
|
360
|
-
_createHelper: function(event) {
|
382
|
+
_createHelper: function( event ) {
|
361
383
|
|
362
384
|
var o = this.options,
|
363
|
-
helperIsFunction =
|
385
|
+
helperIsFunction = typeof o.helper === "function",
|
364
386
|
helper = helperIsFunction ?
|
365
387
|
$( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
|
366
388
|
( o.helper === "clone" ?
|
367
389
|
this.element.clone().removeAttr( "id" ) :
|
368
390
|
this.element );
|
369
391
|
|
370
|
-
if (!helper.parents("body").length) {
|
371
|
-
helper.appendTo((o.appendTo === "parent" ?
|
392
|
+
if ( !helper.parents( "body" ).length ) {
|
393
|
+
helper.appendTo( ( o.appendTo === "parent" ?
|
394
|
+
this.element[ 0 ].parentNode :
|
395
|
+
o.appendTo ) );
|
372
396
|
}
|
373
397
|
|
374
|
-
//
|
398
|
+
// Http://bugs.jqueryui.com/ticket/9446
|
375
399
|
// a helper function can return the original element
|
376
400
|
// which wouldn't have been set to relative in _create
|
377
401
|
if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
|
378
402
|
this._setPositionRelative();
|
379
403
|
}
|
380
404
|
|
381
|
-
if (helper[0] !== this.element[0] &&
|
382
|
-
|
405
|
+
if ( helper[ 0 ] !== this.element[ 0 ] &&
|
406
|
+
!( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) {
|
407
|
+
helper.css( "position", "absolute" );
|
383
408
|
}
|
384
409
|
|
385
410
|
return helper;
|
@@ -392,23 +417,23 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
392
417
|
}
|
393
418
|
},
|
394
419
|
|
395
|
-
_adjustOffsetFromHelper: function(obj) {
|
396
|
-
if (typeof obj === "string") {
|
397
|
-
obj = obj.split(" ");
|
420
|
+
_adjustOffsetFromHelper: function( obj ) {
|
421
|
+
if ( typeof obj === "string" ) {
|
422
|
+
obj = obj.split( " " );
|
398
423
|
}
|
399
|
-
if (
|
400
|
-
obj = { left: +obj[0], top: +obj[1] || 0 };
|
424
|
+
if ( Array.isArray( obj ) ) {
|
425
|
+
obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
|
401
426
|
}
|
402
|
-
if ("left" in obj) {
|
427
|
+
if ( "left" in obj ) {
|
403
428
|
this.offset.click.left = obj.left + this.margins.left;
|
404
429
|
}
|
405
|
-
if ("right" in obj) {
|
430
|
+
if ( "right" in obj ) {
|
406
431
|
this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
|
407
432
|
}
|
408
|
-
if ("top" in obj) {
|
433
|
+
if ( "top" in obj ) {
|
409
434
|
this.offset.click.top = obj.top + this.margins.top;
|
410
435
|
}
|
411
|
-
if ("bottom" in obj) {
|
436
|
+
if ( "bottom" in obj ) {
|
412
437
|
this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
|
413
438
|
}
|
414
439
|
},
|
@@ -423,11 +448,15 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
423
448
|
var po = this.offsetParent.offset(),
|
424
449
|
document = this.document[ 0 ];
|
425
450
|
|
426
|
-
// This is a special case where we need to modify a offset calculated on start, since the
|
427
|
-
//
|
428
|
-
//
|
429
|
-
//
|
430
|
-
|
451
|
+
// This is a special case where we need to modify a offset calculated on start, since the
|
452
|
+
// following happened:
|
453
|
+
// 1. The position of the helper is absolute, so it's position is calculated based on the
|
454
|
+
// next positioned parent
|
455
|
+
// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
|
456
|
+
// the document, which means that the scroll is included in the initial calculation of the
|
457
|
+
// offset of the parent, and never recalculated upon drag
|
458
|
+
if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document &&
|
459
|
+
$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
|
431
460
|
po.left += this.scrollParent.scrollLeft();
|
432
461
|
po.top += this.scrollParent.scrollTop();
|
433
462
|
}
|
@@ -437,8 +466,8 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
437
466
|
}
|
438
467
|
|
439
468
|
return {
|
440
|
-
top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
|
441
|
-
left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
|
469
|
+
top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
|
470
|
+
left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
|
442
471
|
};
|
443
472
|
|
444
473
|
},
|
@@ -452,18 +481,20 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
452
481
|
scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
|
453
482
|
|
454
483
|
return {
|
455
|
-
top: p.top - ( parseInt(this.helper.css( "top" ), 10) || 0 ) +
|
456
|
-
|
484
|
+
top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
|
485
|
+
( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
|
486
|
+
left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
|
487
|
+
( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
|
457
488
|
};
|
458
489
|
|
459
490
|
},
|
460
491
|
|
461
492
|
_cacheMargins: function() {
|
462
493
|
this.margins = {
|
463
|
-
left: (parseInt(this.element.css("marginLeft"), 10) || 0),
|
464
|
-
top: (parseInt(this.element.css("marginTop"), 10) || 0),
|
465
|
-
right: (parseInt(this.element.css("marginRight"), 10) || 0),
|
466
|
-
bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)
|
494
|
+
left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ),
|
495
|
+
top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ),
|
496
|
+
right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ),
|
497
|
+
bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 )
|
467
498
|
};
|
468
499
|
},
|
469
500
|
|
@@ -491,18 +522,22 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
491
522
|
this.containment = [
|
492
523
|
$( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
|
493
524
|
$( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
|
494
|
-
$( window ).scrollLeft() + $( window ).width() -
|
495
|
-
|
525
|
+
$( window ).scrollLeft() + $( window ).width() -
|
526
|
+
this.helperProportions.width - this.margins.left,
|
527
|
+
$( window ).scrollTop() +
|
528
|
+
( $( window ).height() || document.body.parentNode.scrollHeight ) -
|
529
|
+
this.helperProportions.height - this.margins.top
|
496
530
|
];
|
497
531
|
return;
|
498
532
|
}
|
499
533
|
|
500
|
-
if ( o.containment === "document") {
|
534
|
+
if ( o.containment === "document" ) {
|
501
535
|
this.containment = [
|
502
536
|
0,
|
503
537
|
0,
|
504
538
|
$( document ).width() - this.helperProportions.width - this.margins.left,
|
505
|
-
( $( document ).height() || document.body.parentNode.scrollHeight ) -
|
539
|
+
( $( document ).height() || document.body.parentNode.scrollHeight ) -
|
540
|
+
this.helperProportions.height - this.margins.top
|
506
541
|
];
|
507
542
|
return;
|
508
543
|
}
|
@@ -526,8 +561,10 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
526
561
|
isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
|
527
562
|
|
528
563
|
this.containment = [
|
529
|
-
( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) +
|
530
|
-
|
564
|
+
( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) +
|
565
|
+
( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
|
566
|
+
( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) +
|
567
|
+
( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
|
531
568
|
( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
|
532
569
|
( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
|
533
570
|
( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
|
@@ -544,9 +581,9 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
544
581
|
this.relativeContainer = c;
|
545
582
|
},
|
546
583
|
|
547
|
-
_convertPositionTo: function(d, pos) {
|
584
|
+
_convertPositionTo: function( d, pos ) {
|
548
585
|
|
549
|
-
if (!pos) {
|
586
|
+
if ( !pos ) {
|
550
587
|
pos = this.position;
|
551
588
|
}
|
552
589
|
|
@@ -555,16 +592,32 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
555
592
|
|
556
593
|
return {
|
557
594
|
top: (
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
595
|
+
|
596
|
+
// The absolute mouse position
|
597
|
+
pos.top +
|
598
|
+
|
599
|
+
// Only for relative positioned nodes: Relative offset from element to offset parent
|
600
|
+
this.offset.relative.top * mod +
|
601
|
+
|
602
|
+
// The offsetParent's offset without borders (offset + border)
|
603
|
+
this.offset.parent.top * mod -
|
604
|
+
( ( this.cssPosition === "fixed" ?
|
605
|
+
-this.offset.scroll.top :
|
606
|
+
( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod )
|
562
607
|
),
|
563
608
|
left: (
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
609
|
+
|
610
|
+
// The absolute mouse position
|
611
|
+
pos.left +
|
612
|
+
|
613
|
+
// Only for relative positioned nodes: Relative offset from element to offset parent
|
614
|
+
this.offset.relative.left * mod +
|
615
|
+
|
616
|
+
// The offsetParent's offset without borders (offset + border)
|
617
|
+
this.offset.parent.left * mod -
|
618
|
+
( ( this.cssPosition === "fixed" ?
|
619
|
+
-this.offset.scroll.left :
|
620
|
+
( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod )
|
568
621
|
)
|
569
622
|
};
|
570
623
|
|
@@ -594,7 +647,7 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
594
647
|
// If we are not dragging yet, we won't check for options
|
595
648
|
if ( constrainPosition ) {
|
596
649
|
if ( this.containment ) {
|
597
|
-
if ( this.relativeContainer ){
|
650
|
+
if ( this.relativeContainer ) {
|
598
651
|
co = this.relativeContainer.offset();
|
599
652
|
containment = [
|
600
653
|
this.containment[ 0 ] + co.left,
|
@@ -606,27 +659,40 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
606
659
|
containment = this.containment;
|
607
660
|
}
|
608
661
|
|
609
|
-
if (event.pageX - this.offset.click.left < containment[0]) {
|
610
|
-
pageX = containment[0] + this.offset.click.left;
|
662
|
+
if ( event.pageX - this.offset.click.left < containment[ 0 ] ) {
|
663
|
+
pageX = containment[ 0 ] + this.offset.click.left;
|
611
664
|
}
|
612
|
-
if (event.pageY - this.offset.click.top < containment[1]) {
|
613
|
-
pageY = containment[1] + this.offset.click.top;
|
665
|
+
if ( event.pageY - this.offset.click.top < containment[ 1 ] ) {
|
666
|
+
pageY = containment[ 1 ] + this.offset.click.top;
|
614
667
|
}
|
615
|
-
if (event.pageX - this.offset.click.left > containment[2]) {
|
616
|
-
pageX = containment[2] + this.offset.click.left;
|
668
|
+
if ( event.pageX - this.offset.click.left > containment[ 2 ] ) {
|
669
|
+
pageX = containment[ 2 ] + this.offset.click.left;
|
617
670
|
}
|
618
|
-
if (event.pageY - this.offset.click.top > containment[3]) {
|
619
|
-
pageY = containment[3] + this.offset.click.top;
|
671
|
+
if ( event.pageY - this.offset.click.top > containment[ 3 ] ) {
|
672
|
+
pageY = containment[ 3 ] + this.offset.click.top;
|
620
673
|
}
|
621
674
|
}
|
622
675
|
|
623
|
-
if (o.grid) {
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
676
|
+
if ( o.grid ) {
|
677
|
+
|
678
|
+
//Check for grid elements set to 0 to prevent divide by 0 error causing invalid
|
679
|
+
// argument errors in IE (see ticket #6950)
|
680
|
+
top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY -
|
681
|
+
this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY;
|
682
|
+
pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] ||
|
683
|
+
top - this.offset.click.top > containment[ 3 ] ) ?
|
684
|
+
top :
|
685
|
+
( ( top - this.offset.click.top >= containment[ 1 ] ) ?
|
686
|
+
top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top;
|
687
|
+
|
688
|
+
left = o.grid[ 0 ] ? this.originalPageX +
|
689
|
+
Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] :
|
690
|
+
this.originalPageX;
|
691
|
+
pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] ||
|
692
|
+
left - this.offset.click.left > containment[ 2 ] ) ?
|
693
|
+
left :
|
694
|
+
( ( left - this.offset.click.left >= containment[ 0 ] ) ?
|
695
|
+
left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left;
|
630
696
|
}
|
631
697
|
|
632
698
|
if ( o.axis === "y" ) {
|
@@ -640,26 +706,46 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
640
706
|
|
641
707
|
return {
|
642
708
|
top: (
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
709
|
+
|
710
|
+
// The absolute mouse position
|
711
|
+
pageY -
|
712
|
+
|
713
|
+
// Click offset (relative to the element)
|
714
|
+
this.offset.click.top -
|
715
|
+
|
716
|
+
// Only for relative positioned nodes: Relative offset from element to offset parent
|
717
|
+
this.offset.relative.top -
|
718
|
+
|
719
|
+
// The offsetParent's offset without borders (offset + border)
|
720
|
+
this.offset.parent.top +
|
721
|
+
( this.cssPosition === "fixed" ?
|
722
|
+
-this.offset.scroll.top :
|
723
|
+
( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
|
648
724
|
),
|
649
725
|
left: (
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
726
|
+
|
727
|
+
// The absolute mouse position
|
728
|
+
pageX -
|
729
|
+
|
730
|
+
// Click offset (relative to the element)
|
731
|
+
this.offset.click.left -
|
732
|
+
|
733
|
+
// Only for relative positioned nodes: Relative offset from element to offset parent
|
734
|
+
this.offset.relative.left -
|
735
|
+
|
736
|
+
// The offsetParent's offset without borders (offset + border)
|
737
|
+
this.offset.parent.left +
|
738
|
+
( this.cssPosition === "fixed" ?
|
739
|
+
-this.offset.scroll.left :
|
740
|
+
( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
|
655
741
|
)
|
656
742
|
};
|
657
743
|
|
658
744
|
},
|
659
745
|
|
660
746
|
_clear: function() {
|
661
|
-
this.helper
|
662
|
-
if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
|
747
|
+
this._removeClass( this.helper, "ui-draggable-dragging" );
|
748
|
+
if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) {
|
663
749
|
this.helper.remove();
|
664
750
|
}
|
665
751
|
this.helper = null;
|
@@ -669,17 +755,6 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
669
755
|
}
|
670
756
|
},
|
671
757
|
|
672
|
-
_normalizeRightBottom: function() {
|
673
|
-
if ( this.options.axis !== "y" && this.helper.css( "right" ) !== "auto" ) {
|
674
|
-
this.helper.width( this.helper.width() );
|
675
|
-
this.helper.css( "right", "auto" );
|
676
|
-
}
|
677
|
-
if ( this.options.axis !== "x" && this.helper.css( "bottom" ) !== "auto" ) {
|
678
|
-
this.helper.height( this.helper.height() );
|
679
|
-
this.helper.css( "bottom", "auto" );
|
680
|
-
}
|
681
|
-
},
|
682
|
-
|
683
758
|
// From now on bulk stuff - mainly helpers
|
684
759
|
|
685
760
|
_trigger: function( type, event, ui ) {
|
@@ -705,33 +780,33 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|
705
780
|
};
|
706
781
|
}
|
707
782
|
|
708
|
-
});
|
783
|
+
} );
|
709
784
|
|
710
785
|
$.ui.plugin.add( "draggable", "connectToSortable", {
|
711
786
|
start: function( event, ui, draggable ) {
|
712
787
|
var uiSortable = $.extend( {}, ui, {
|
713
788
|
item: draggable.element
|
714
|
-
});
|
789
|
+
} );
|
715
790
|
|
716
791
|
draggable.sortables = [];
|
717
|
-
$( draggable.options.connectToSortable ).each(function() {
|
792
|
+
$( draggable.options.connectToSortable ).each( function() {
|
718
793
|
var sortable = $( this ).sortable( "instance" );
|
719
794
|
|
720
795
|
if ( sortable && !sortable.options.disabled ) {
|
721
796
|
draggable.sortables.push( sortable );
|
722
797
|
|
723
|
-
//
|
798
|
+
// RefreshPositions is called at drag start to refresh the containerCache
|
724
799
|
// which is used in drag. This ensures it's initialized and synchronized
|
725
800
|
// with any changes that might have happened on the page since initialization.
|
726
801
|
sortable.refreshPositions();
|
727
|
-
sortable._trigger("activate", event, uiSortable);
|
802
|
+
sortable._trigger( "activate", event, uiSortable );
|
728
803
|
}
|
729
|
-
});
|
804
|
+
} );
|
730
805
|
},
|
731
806
|
stop: function( event, ui, draggable ) {
|
732
807
|
var uiSortable = $.extend( {}, ui, {
|
733
808
|
item: draggable.element
|
734
|
-
});
|
809
|
+
} );
|
735
810
|
|
736
811
|
draggable.cancelHelperRemoval = false;
|
737
812
|
|
@@ -754,12 +829,13 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
|
|
754
829
|
left: sortable.placeholder.css( "left" )
|
755
830
|
};
|
756
831
|
|
757
|
-
sortable._mouseStop(event);
|
832
|
+
sortable._mouseStop( event );
|
758
833
|
|
759
834
|
// Once drag has ended, the sortable should return to using
|
760
835
|
// its original helper, not the shared helper from draggable
|
761
836
|
sortable.options.helper = sortable.options._helper;
|
762
837
|
} else {
|
838
|
+
|
763
839
|
// Prevent this Sortable from removing the helper.
|
764
840
|
// However, don't set the draggable to remove the helper
|
765
841
|
// either as another connected Sortable may yet handle the removal.
|
@@ -767,7 +843,7 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
|
|
767
843
|
|
768
844
|
sortable._trigger( "deactivate", event, uiSortable );
|
769
845
|
}
|
770
|
-
});
|
846
|
+
} );
|
771
847
|
},
|
772
848
|
drag: function( event, ui, draggable ) {
|
773
849
|
$.each( draggable.sortables, function() {
|
@@ -783,6 +859,7 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
|
|
783
859
|
innermostIntersecting = true;
|
784
860
|
|
785
861
|
$.each( draggable.sortables, function() {
|
862
|
+
|
786
863
|
// Copy over variables that sortable's _intersectsWith uses
|
787
864
|
this.positionAbs = draggable.positionAbs;
|
788
865
|
this.helperProportions = draggable.helperProportions;
|
@@ -795,15 +872,19 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
|
|
795
872
|
}
|
796
873
|
|
797
874
|
return innermostIntersecting;
|
798
|
-
});
|
875
|
+
} );
|
799
876
|
}
|
800
877
|
|
801
878
|
if ( innermostIntersecting ) {
|
879
|
+
|
802
880
|
// If it intersects, we use a little isOver variable and set it once,
|
803
881
|
// so that the move-in stuff gets fired only once.
|
804
882
|
if ( !sortable.isOver ) {
|
805
883
|
sortable.isOver = 1;
|
806
884
|
|
885
|
+
// Store draggable's parent in case we need to reappend to it later.
|
886
|
+
draggable._parent = ui.helper.parent();
|
887
|
+
|
807
888
|
sortable.currentItem = ui.helper
|
808
889
|
.appendTo( sortable.element )
|
809
890
|
.data( "ui-sortable-item", true );
|
@@ -840,21 +921,23 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
|
|
840
921
|
// adding to one sortable changes the location of the other sortables (#9675)
|
841
922
|
$.each( draggable.sortables, function() {
|
842
923
|
this.refreshPositions();
|
843
|
-
});
|
924
|
+
} );
|
844
925
|
|
845
|
-
//
|
926
|
+
// Hack so receive/update callbacks work (mostly)
|
846
927
|
draggable.currentItem = draggable.element;
|
847
928
|
sortable.fromOutside = draggable;
|
848
929
|
}
|
849
930
|
|
850
931
|
if ( sortable.currentItem ) {
|
851
932
|
sortable._mouseDrag( event );
|
933
|
+
|
852
934
|
// Copy the sortable's position because the draggable's can potentially reflect
|
853
935
|
// a relative position, while sortable is always absolute, which the dragged
|
854
936
|
// element has now become. (#8809)
|
855
937
|
ui.position = sortable.position;
|
856
938
|
}
|
857
939
|
} else {
|
940
|
+
|
858
941
|
// If it doesn't intersect with the sortable, and it intersected before,
|
859
942
|
// we fake the drag stop of the sortable, but make sure it doesn't remove
|
860
943
|
// the helper by using cancelHelperRemoval.
|
@@ -871,7 +954,7 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
|
|
871
954
|
sortable._trigger( "out", event, sortable._uiHash( sortable ) );
|
872
955
|
sortable._mouseStop( event, true );
|
873
956
|
|
874
|
-
//
|
957
|
+
// Restore sortable behaviors that were modfied
|
875
958
|
// when the draggable entered the sortable area (#9481)
|
876
959
|
sortable.options.revert = sortable.options._revert;
|
877
960
|
sortable.options.helper = sortable.options._helper;
|
@@ -880,8 +963,9 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
|
|
880
963
|
sortable.placeholder.remove();
|
881
964
|
}
|
882
965
|
|
883
|
-
//
|
884
|
-
// may have modified them in unexpected ways (#8809)
|
966
|
+
// Restore and recalculate the draggable's offset considering the sortable
|
967
|
+
// may have modified them in unexpected ways. (#8809, #10669)
|
968
|
+
ui.helper.appendTo( draggable._parent );
|
885
969
|
draggable._refreshOffsets( event );
|
886
970
|
ui.position = draggable._generatePosition( event, true );
|
887
971
|
|
@@ -894,55 +978,56 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
|
|
894
978
|
// from one sortable changes the location of other sortables (#9675)
|
895
979
|
$.each( draggable.sortables, function() {
|
896
980
|
this.refreshPositions();
|
897
|
-
});
|
981
|
+
} );
|
898
982
|
}
|
899
983
|
}
|
900
|
-
});
|
984
|
+
} );
|
901
985
|
}
|
902
|
-
});
|
986
|
+
} );
|
903
987
|
|
904
|
-
$.ui.plugin.add("draggable", "cursor", {
|
988
|
+
$.ui.plugin.add( "draggable", "cursor", {
|
905
989
|
start: function( event, ui, instance ) {
|
906
990
|
var t = $( "body" ),
|
907
991
|
o = instance.options;
|
908
992
|
|
909
|
-
if (t.css("cursor")) {
|
910
|
-
o._cursor = t.css("cursor");
|
993
|
+
if ( t.css( "cursor" ) ) {
|
994
|
+
o._cursor = t.css( "cursor" );
|
911
995
|
}
|
912
|
-
t.css("cursor", o.cursor);
|
996
|
+
t.css( "cursor", o.cursor );
|
913
997
|
},
|
914
998
|
stop: function( event, ui, instance ) {
|
915
999
|
var o = instance.options;
|
916
|
-
if (o._cursor) {
|
917
|
-
$("body").css("cursor", o._cursor);
|
1000
|
+
if ( o._cursor ) {
|
1001
|
+
$( "body" ).css( "cursor", o._cursor );
|
918
1002
|
}
|
919
1003
|
}
|
920
|
-
});
|
1004
|
+
} );
|
921
1005
|
|
922
|
-
$.ui.plugin.add("draggable", "opacity", {
|
1006
|
+
$.ui.plugin.add( "draggable", "opacity", {
|
923
1007
|
start: function( event, ui, instance ) {
|
924
1008
|
var t = $( ui.helper ),
|
925
1009
|
o = instance.options;
|
926
|
-
if (t.css("opacity")) {
|
927
|
-
o._opacity = t.css("opacity");
|
1010
|
+
if ( t.css( "opacity" ) ) {
|
1011
|
+
o._opacity = t.css( "opacity" );
|
928
1012
|
}
|
929
|
-
t.css("opacity", o.opacity);
|
1013
|
+
t.css( "opacity", o.opacity );
|
930
1014
|
},
|
931
1015
|
stop: function( event, ui, instance ) {
|
932
1016
|
var o = instance.options;
|
933
|
-
if (o._opacity) {
|
934
|
-
$(ui.helper).css("opacity", o._opacity);
|
1017
|
+
if ( o._opacity ) {
|
1018
|
+
$( ui.helper ).css( "opacity", o._opacity );
|
935
1019
|
}
|
936
1020
|
}
|
937
|
-
});
|
1021
|
+
} );
|
938
1022
|
|
939
|
-
$.ui.plugin.add("draggable", "scroll", {
|
1023
|
+
$.ui.plugin.add( "draggable", "scroll", {
|
940
1024
|
start: function( event, ui, i ) {
|
941
1025
|
if ( !i.scrollParentNotHidden ) {
|
942
1026
|
i.scrollParentNotHidden = i.helper.scrollParent( false );
|
943
1027
|
}
|
944
1028
|
|
945
|
-
if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] &&
|
1029
|
+
if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] &&
|
1030
|
+
i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
|
946
1031
|
i.overflowOffset = i.scrollParentNotHidden.offset();
|
947
1032
|
}
|
948
1033
|
},
|
@@ -955,7 +1040,8 @@ $.ui.plugin.add("draggable", "scroll", {
|
|
955
1040
|
|
956
1041
|
if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
|
957
1042
|
if ( !o.axis || o.axis !== "x" ) {
|
958
|
-
if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY <
|
1043
|
+
if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY <
|
1044
|
+
o.scrollSensitivity ) {
|
959
1045
|
scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
|
960
1046
|
} else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
|
961
1047
|
scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
|
@@ -963,7 +1049,8 @@ $.ui.plugin.add("draggable", "scroll", {
|
|
963
1049
|
}
|
964
1050
|
|
965
1051
|
if ( !o.axis || o.axis !== "y" ) {
|
966
|
-
if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX <
|
1052
|
+
if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX <
|
1053
|
+
o.scrollSensitivity ) {
|
967
1054
|
scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
|
968
1055
|
} else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
|
969
1056
|
scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
|
@@ -972,49 +1059,56 @@ $.ui.plugin.add("draggable", "scroll", {
|
|
972
1059
|
|
973
1060
|
} else {
|
974
1061
|
|
975
|
-
if (!o.axis || o.axis !== "x") {
|
976
|
-
if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
|
977
|
-
scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
|
978
|
-
} else if ($(window).height() - (event.pageY - $(document).scrollTop()) <
|
979
|
-
|
1062
|
+
if ( !o.axis || o.axis !== "x" ) {
|
1063
|
+
if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) {
|
1064
|
+
scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed );
|
1065
|
+
} else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) <
|
1066
|
+
o.scrollSensitivity ) {
|
1067
|
+
scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed );
|
980
1068
|
}
|
981
1069
|
}
|
982
1070
|
|
983
|
-
if (!o.axis || o.axis !== "y") {
|
984
|
-
if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
|
985
|
-
scrolled = $(document).scrollLeft(
|
986
|
-
|
987
|
-
|
1071
|
+
if ( !o.axis || o.axis !== "y" ) {
|
1072
|
+
if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) {
|
1073
|
+
scrolled = $( document ).scrollLeft(
|
1074
|
+
$( document ).scrollLeft() - o.scrollSpeed
|
1075
|
+
);
|
1076
|
+
} else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) <
|
1077
|
+
o.scrollSensitivity ) {
|
1078
|
+
scrolled = $( document ).scrollLeft(
|
1079
|
+
$( document ).scrollLeft() + o.scrollSpeed
|
1080
|
+
);
|
988
1081
|
}
|
989
1082
|
}
|
990
1083
|
|
991
1084
|
}
|
992
1085
|
|
993
|
-
if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
|
994
|
-
$.ui.ddmanager.prepareOffsets(i, event);
|
1086
|
+
if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
|
1087
|
+
$.ui.ddmanager.prepareOffsets( i, event );
|
995
1088
|
}
|
996
1089
|
|
997
1090
|
}
|
998
|
-
});
|
1091
|
+
} );
|
999
1092
|
|
1000
|
-
$.ui.plugin.add("draggable", "snap", {
|
1093
|
+
$.ui.plugin.add( "draggable", "snap", {
|
1001
1094
|
start: function( event, ui, i ) {
|
1002
1095
|
|
1003
1096
|
var o = i.options;
|
1004
1097
|
|
1005
1098
|
i.snapElements = [];
|
1006
1099
|
|
1007
|
-
$(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap)
|
1008
|
-
|
1009
|
-
$
|
1010
|
-
|
1011
|
-
i.
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1100
|
+
$( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap )
|
1101
|
+
.each( function() {
|
1102
|
+
var $t = $( this ),
|
1103
|
+
$o = $t.offset();
|
1104
|
+
if ( this !== i.element[ 0 ] ) {
|
1105
|
+
i.snapElements.push( {
|
1106
|
+
item: this,
|
1107
|
+
width: $t.outerWidth(), height: $t.outerHeight(),
|
1108
|
+
top: $o.top, left: $o.left
|
1109
|
+
} );
|
1110
|
+
}
|
1111
|
+
} );
|
1018
1112
|
|
1019
1113
|
},
|
1020
1114
|
drag: function( event, ui, inst ) {
|
@@ -1025,108 +1119,150 @@ $.ui.plugin.add("draggable", "snap", {
|
|
1025
1119
|
x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
|
1026
1120
|
y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
|
1027
1121
|
|
1028
|
-
for (i = inst.snapElements.length - 1; i >= 0; i--){
|
1029
|
-
|
1030
|
-
l = inst.snapElements[i].left - inst.margins.left;
|
1031
|
-
r = l + inst.snapElements[i].width;
|
1032
|
-
t = inst.snapElements[i].top - inst.margins.top;
|
1033
|
-
b = t + inst.snapElements[i].height;
|
1034
|
-
|
1035
|
-
if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d ||
|
1036
|
-
|
1037
|
-
|
1122
|
+
for ( i = inst.snapElements.length - 1; i >= 0; i-- ) {
|
1123
|
+
|
1124
|
+
l = inst.snapElements[ i ].left - inst.margins.left;
|
1125
|
+
r = l + inst.snapElements[ i ].width;
|
1126
|
+
t = inst.snapElements[ i ].top - inst.margins.top;
|
1127
|
+
b = t + inst.snapElements[ i ].height;
|
1128
|
+
|
1129
|
+
if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d ||
|
1130
|
+
!$.contains( inst.snapElements[ i ].item.ownerDocument,
|
1131
|
+
inst.snapElements[ i ].item ) ) {
|
1132
|
+
if ( inst.snapElements[ i ].snapping ) {
|
1133
|
+
if ( inst.options.snap.release ) {
|
1134
|
+
inst.options.snap.release.call(
|
1135
|
+
inst.element,
|
1136
|
+
event,
|
1137
|
+
$.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } )
|
1138
|
+
);
|
1139
|
+
}
|
1038
1140
|
}
|
1039
|
-
inst.snapElements[i].snapping = false;
|
1141
|
+
inst.snapElements[ i ].snapping = false;
|
1040
1142
|
continue;
|
1041
1143
|
}
|
1042
1144
|
|
1043
|
-
if (o.snapMode !== "inner") {
|
1044
|
-
ts = Math.abs(t - y2) <= d;
|
1045
|
-
bs = Math.abs(b - y1) <= d;
|
1046
|
-
ls = Math.abs(l - x2) <= d;
|
1047
|
-
rs = Math.abs(r - x1) <= d;
|
1048
|
-
if (ts) {
|
1049
|
-
ui.position.top = inst._convertPositionTo("relative", {
|
1145
|
+
if ( o.snapMode !== "inner" ) {
|
1146
|
+
ts = Math.abs( t - y2 ) <= d;
|
1147
|
+
bs = Math.abs( b - y1 ) <= d;
|
1148
|
+
ls = Math.abs( l - x2 ) <= d;
|
1149
|
+
rs = Math.abs( r - x1 ) <= d;
|
1150
|
+
if ( ts ) {
|
1151
|
+
ui.position.top = inst._convertPositionTo( "relative", {
|
1152
|
+
top: t - inst.helperProportions.height,
|
1153
|
+
left: 0
|
1154
|
+
} ).top;
|
1050
1155
|
}
|
1051
|
-
if (bs) {
|
1052
|
-
ui.position.top = inst._convertPositionTo("relative", {
|
1156
|
+
if ( bs ) {
|
1157
|
+
ui.position.top = inst._convertPositionTo( "relative", {
|
1158
|
+
top: b,
|
1159
|
+
left: 0
|
1160
|
+
} ).top;
|
1053
1161
|
}
|
1054
|
-
if (ls) {
|
1055
|
-
ui.position.left = inst._convertPositionTo("relative", {
|
1162
|
+
if ( ls ) {
|
1163
|
+
ui.position.left = inst._convertPositionTo( "relative", {
|
1164
|
+
top: 0,
|
1165
|
+
left: l - inst.helperProportions.width
|
1166
|
+
} ).left;
|
1056
1167
|
}
|
1057
|
-
if (rs) {
|
1058
|
-
ui.position.left = inst._convertPositionTo("relative", {
|
1168
|
+
if ( rs ) {
|
1169
|
+
ui.position.left = inst._convertPositionTo( "relative", {
|
1170
|
+
top: 0,
|
1171
|
+
left: r
|
1172
|
+
} ).left;
|
1059
1173
|
}
|
1060
1174
|
}
|
1061
1175
|
|
1062
|
-
first = (ts || bs || ls || rs);
|
1063
|
-
|
1064
|
-
if (o.snapMode !== "outer") {
|
1065
|
-
ts = Math.abs(t - y1) <= d;
|
1066
|
-
bs = Math.abs(b - y2) <= d;
|
1067
|
-
ls = Math.abs(l - x1) <= d;
|
1068
|
-
rs = Math.abs(r - x2) <= d;
|
1069
|
-
if (ts) {
|
1070
|
-
ui.position.top = inst._convertPositionTo("relative", {
|
1176
|
+
first = ( ts || bs || ls || rs );
|
1177
|
+
|
1178
|
+
if ( o.snapMode !== "outer" ) {
|
1179
|
+
ts = Math.abs( t - y1 ) <= d;
|
1180
|
+
bs = Math.abs( b - y2 ) <= d;
|
1181
|
+
ls = Math.abs( l - x1 ) <= d;
|
1182
|
+
rs = Math.abs( r - x2 ) <= d;
|
1183
|
+
if ( ts ) {
|
1184
|
+
ui.position.top = inst._convertPositionTo( "relative", {
|
1185
|
+
top: t,
|
1186
|
+
left: 0
|
1187
|
+
} ).top;
|
1071
1188
|
}
|
1072
|
-
if (bs) {
|
1073
|
-
ui.position.top = inst._convertPositionTo("relative", {
|
1189
|
+
if ( bs ) {
|
1190
|
+
ui.position.top = inst._convertPositionTo( "relative", {
|
1191
|
+
top: b - inst.helperProportions.height,
|
1192
|
+
left: 0
|
1193
|
+
} ).top;
|
1074
1194
|
}
|
1075
|
-
if (ls) {
|
1076
|
-
ui.position.left = inst._convertPositionTo("relative", {
|
1195
|
+
if ( ls ) {
|
1196
|
+
ui.position.left = inst._convertPositionTo( "relative", {
|
1197
|
+
top: 0,
|
1198
|
+
left: l
|
1199
|
+
} ).left;
|
1077
1200
|
}
|
1078
|
-
if (rs) {
|
1079
|
-
ui.position.left = inst._convertPositionTo("relative", {
|
1201
|
+
if ( rs ) {
|
1202
|
+
ui.position.left = inst._convertPositionTo( "relative", {
|
1203
|
+
top: 0,
|
1204
|
+
left: r - inst.helperProportions.width
|
1205
|
+
} ).left;
|
1080
1206
|
}
|
1081
1207
|
}
|
1082
1208
|
|
1083
|
-
if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
|
1084
|
-
(
|
1209
|
+
if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) {
|
1210
|
+
if ( inst.options.snap.snap ) {
|
1211
|
+
inst.options.snap.snap.call(
|
1212
|
+
inst.element,
|
1213
|
+
event,
|
1214
|
+
$.extend( inst._uiHash(), {
|
1215
|
+
snapItem: inst.snapElements[ i ].item
|
1216
|
+
} ) );
|
1217
|
+
}
|
1085
1218
|
}
|
1086
|
-
inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
|
1219
|
+
inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first );
|
1087
1220
|
|
1088
1221
|
}
|
1089
1222
|
|
1090
1223
|
}
|
1091
|
-
});
|
1224
|
+
} );
|
1092
1225
|
|
1093
|
-
$.ui.plugin.add("draggable", "stack", {
|
1226
|
+
$.ui.plugin.add( "draggable", "stack", {
|
1094
1227
|
start: function( event, ui, instance ) {
|
1095
1228
|
var min,
|
1096
1229
|
o = instance.options,
|
1097
|
-
group = $.makeArray($(o.stack)).sort(function(a, b) {
|
1098
|
-
return (parseInt($(a).css("zIndex"), 10) || 0) -
|
1099
|
-
|
1230
|
+
group = $.makeArray( $( o.stack ) ).sort( function( a, b ) {
|
1231
|
+
return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) -
|
1232
|
+
( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 );
|
1233
|
+
} );
|
1100
1234
|
|
1101
|
-
if (!group.length) {
|
1235
|
+
if ( !group.length ) {
|
1236
|
+
return;
|
1237
|
+
}
|
1102
1238
|
|
1103
|
-
min = parseInt($(group[0]).css("zIndex"), 10) || 0;
|
1104
|
-
$(group).each(function(i) {
|
1105
|
-
$(this).css("zIndex", min + i);
|
1106
|
-
});
|
1107
|
-
this.css("zIndex", (min + group.length));
|
1239
|
+
min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0;
|
1240
|
+
$( group ).each( function( i ) {
|
1241
|
+
$( this ).css( "zIndex", min + i );
|
1242
|
+
} );
|
1243
|
+
this.css( "zIndex", ( min + group.length ) );
|
1108
1244
|
}
|
1109
|
-
});
|
1245
|
+
} );
|
1110
1246
|
|
1111
|
-
$.ui.plugin.add("draggable", "zIndex", {
|
1247
|
+
$.ui.plugin.add( "draggable", "zIndex", {
|
1112
1248
|
start: function( event, ui, instance ) {
|
1113
1249
|
var t = $( ui.helper ),
|
1114
1250
|
o = instance.options;
|
1115
1251
|
|
1116
|
-
if (t.css("zIndex")) {
|
1117
|
-
o._zIndex = t.css("zIndex");
|
1252
|
+
if ( t.css( "zIndex" ) ) {
|
1253
|
+
o._zIndex = t.css( "zIndex" );
|
1118
1254
|
}
|
1119
|
-
t.css("zIndex", o.zIndex);
|
1255
|
+
t.css( "zIndex", o.zIndex );
|
1120
1256
|
},
|
1121
1257
|
stop: function( event, ui, instance ) {
|
1122
1258
|
var o = instance.options;
|
1123
1259
|
|
1124
|
-
if (o._zIndex) {
|
1125
|
-
$(ui.helper).css("zIndex", o._zIndex);
|
1260
|
+
if ( o._zIndex ) {
|
1261
|
+
$( ui.helper ).css( "zIndex", o._zIndex );
|
1126
1262
|
}
|
1127
1263
|
}
|
1128
|
-
});
|
1264
|
+
} );
|
1129
1265
|
|
1130
1266
|
return $.ui.draggable;
|
1131
1267
|
|
1132
|
-
})
|
1268
|
+
} );
|