jquery-ui-rails 4.0.0 → 5.0.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of jquery-ui-rails might be problematic. Click here for more details.

Files changed (239) hide show
  1. data/.travis.yml +0 -1
  2. data/Gemfile +1 -1
  3. data/History.md +62 -0
  4. data/README.md +86 -74
  5. data/Rakefile +69 -37
  6. data/VERSIONS.md +36 -0
  7. data/{vendor → app}/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  8. data/{vendor → app}/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
  9. data/{vendor → app}/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  10. data/{vendor → app}/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  11. data/{vendor → app}/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png +0 -0
  12. data/{vendor → app}/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  13. data/{vendor → app}/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  14. data/{vendor → app}/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  15. data/{vendor → app}/assets/images/jquery-ui/ui-icons_222222_256x240.png +0 -0
  16. data/{vendor → app}/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
  17. data/{vendor → app}/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
  18. data/{vendor → app}/assets/images/jquery-ui/ui-icons_888888_256x240.png +0 -0
  19. data/{vendor → app}/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
  20. data/{vendor/assets/javascripts/jquery.ui.accordion.js → app/assets/javascripts/jquery-ui/accordion.js} +90 -74
  21. data/{vendor/assets/javascripts/jquery.ui.autocomplete.js → app/assets/javascripts/jquery-ui/autocomplete.js} +105 -91
  22. data/{vendor/assets/javascripts/jquery.ui.button.js → app/assets/javascripts/jquery-ui/button.js} +60 -68
  23. data/{vendor/assets/javascripts/jquery.ui.core.js → app/assets/javascripts/jquery-ui/core.js} +112 -132
  24. data/app/assets/javascripts/jquery-ui/datepicker-af.js +37 -0
  25. data/app/assets/javascripts/jquery-ui/datepicker-ar-DZ.js +37 -0
  26. data/app/assets/javascripts/jquery-ui/datepicker-ar.js +38 -0
  27. data/app/assets/javascripts/jquery-ui/datepicker-az.js +37 -0
  28. data/app/assets/javascripts/jquery-ui/datepicker-be.js +37 -0
  29. data/app/assets/javascripts/jquery-ui/datepicker-bg.js +38 -0
  30. data/app/assets/javascripts/jquery-ui/datepicker-bs.js +37 -0
  31. data/app/assets/javascripts/jquery-ui/datepicker-ca.js +37 -0
  32. data/app/assets/javascripts/jquery-ui/datepicker-cs.js +37 -0
  33. data/app/assets/javascripts/jquery-ui/datepicker-cy-GB.js +37 -0
  34. data/app/assets/javascripts/jquery-ui/datepicker-da.js +37 -0
  35. data/app/assets/javascripts/jquery-ui/datepicker-de.js +37 -0
  36. data/app/assets/javascripts/jquery-ui/datepicker-el.js +37 -0
  37. data/app/assets/javascripts/jquery-ui/datepicker-en-AU.js +37 -0
  38. data/app/assets/javascripts/jquery-ui/datepicker-en-GB.js +37 -0
  39. data/app/assets/javascripts/jquery-ui/datepicker-en-NZ.js +37 -0
  40. data/app/assets/javascripts/jquery-ui/datepicker-eo.js +37 -0
  41. data/app/assets/javascripts/jquery-ui/datepicker-es.js +37 -0
  42. data/app/assets/javascripts/jquery-ui/datepicker-et.js +37 -0
  43. data/app/assets/javascripts/jquery-ui/datepicker-eu.js +36 -0
  44. data/app/assets/javascripts/jquery-ui/datepicker-fa.js +73 -0
  45. data/app/assets/javascripts/jquery-ui/datepicker-fi.js +37 -0
  46. data/app/assets/javascripts/jquery-ui/datepicker-fo.js +37 -0
  47. data/app/assets/javascripts/jquery-ui/datepicker-fr-CA.js +37 -0
  48. data/app/assets/javascripts/jquery-ui/datepicker-fr-CH.js +37 -0
  49. data/app/assets/javascripts/jquery-ui/datepicker-fr.js +39 -0
  50. data/app/assets/javascripts/jquery-ui/datepicker-gl.js +37 -0
  51. data/app/assets/javascripts/jquery-ui/datepicker-he.js +37 -0
  52. data/app/assets/javascripts/jquery-ui/datepicker-hi.js +37 -0
  53. data/app/assets/javascripts/jquery-ui/datepicker-hr.js +37 -0
  54. data/app/assets/javascripts/jquery-ui/datepicker-hu.js +36 -0
  55. data/app/assets/javascripts/jquery-ui/datepicker-hy.js +37 -0
  56. data/app/assets/javascripts/jquery-ui/datepicker-id.js +37 -0
  57. data/app/assets/javascripts/jquery-ui/datepicker-is.js +37 -0
  58. data/app/assets/javascripts/jquery-ui/datepicker-it-CH.js +37 -0
  59. data/app/assets/javascripts/jquery-ui/datepicker-it.js +37 -0
  60. data/app/assets/javascripts/jquery-ui/datepicker-ja.js +37 -0
  61. data/app/assets/javascripts/jquery-ui/datepicker-ka.js +35 -0
  62. data/app/assets/javascripts/jquery-ui/datepicker-kk.js +37 -0
  63. data/app/assets/javascripts/jquery-ui/datepicker-km.js +37 -0
  64. data/app/assets/javascripts/jquery-ui/datepicker-ko.js +37 -0
  65. data/app/assets/javascripts/jquery-ui/datepicker-ky.js +38 -0
  66. data/app/assets/javascripts/jquery-ui/datepicker-lb.js +37 -0
  67. data/app/assets/javascripts/jquery-ui/datepicker-lt.js +37 -0
  68. data/app/assets/javascripts/jquery-ui/datepicker-lv.js +37 -0
  69. data/app/assets/javascripts/jquery-ui/datepicker-mk.js +37 -0
  70. data/app/assets/javascripts/jquery-ui/datepicker-ml.js +37 -0
  71. data/app/assets/javascripts/jquery-ui/datepicker-ms.js +37 -0
  72. data/app/assets/javascripts/jquery-ui/datepicker-nb.js +36 -0
  73. data/app/assets/javascripts/jquery-ui/datepicker-nl-BE.js +37 -0
  74. data/app/assets/javascripts/jquery-ui/datepicker-nl.js +37 -0
  75. data/app/assets/javascripts/jquery-ui/datepicker-nn.js +36 -0
  76. data/app/assets/javascripts/jquery-ui/datepicker-no.js +37 -0
  77. data/app/assets/javascripts/jquery-ui/datepicker-pl.js +37 -0
  78. data/app/assets/javascripts/jquery-ui/datepicker-pt-BR.js +37 -0
  79. data/app/assets/javascripts/jquery-ui/datepicker-pt.js +36 -0
  80. data/app/assets/javascripts/jquery-ui/datepicker-rm.js +35 -0
  81. data/app/assets/javascripts/jquery-ui/datepicker-ro.js +40 -0
  82. data/app/assets/javascripts/jquery-ui/datepicker-ru.js +37 -0
  83. data/app/assets/javascripts/jquery-ui/datepicker-sk.js +37 -0
  84. data/app/assets/javascripts/jquery-ui/datepicker-sl.js +38 -0
  85. data/app/assets/javascripts/jquery-ui/datepicker-sq.js +37 -0
  86. data/app/assets/javascripts/jquery-ui/datepicker-sr-SR.js +37 -0
  87. data/app/assets/javascripts/jquery-ui/datepicker-sr.js +37 -0
  88. data/app/assets/javascripts/jquery-ui/datepicker-sv.js +37 -0
  89. data/app/assets/javascripts/jquery-ui/datepicker-ta.js +37 -0
  90. data/app/assets/javascripts/jquery-ui/datepicker-th.js +37 -0
  91. data/app/assets/javascripts/jquery-ui/datepicker-tj.js +37 -0
  92. data/app/assets/javascripts/jquery-ui/datepicker-tr.js +37 -0
  93. data/app/assets/javascripts/jquery-ui/datepicker-uk.js +38 -0
  94. data/app/assets/javascripts/jquery-ui/datepicker-vi.js +37 -0
  95. data/app/assets/javascripts/jquery-ui/datepicker-zh-CN.js +37 -0
  96. data/app/assets/javascripts/jquery-ui/datepicker-zh-HK.js +37 -0
  97. data/app/assets/javascripts/jquery-ui/datepicker-zh-TW.js +37 -0
  98. data/{vendor/assets/javascripts/jquery.ui.datepicker.js → app/assets/javascripts/jquery-ui/datepicker.js} +120 -80
  99. data/{vendor/assets/javascripts/jquery.ui.dialog.js → app/assets/javascripts/jquery-ui/dialog.js} +298 -190
  100. data/app/assets/javascripts/jquery-ui/draggable.js +1132 -0
  101. data/app/assets/javascripts/jquery-ui/droppable.js +418 -0
  102. data/{vendor/assets/javascripts/jquery.ui.effect-blind.js → app/assets/javascripts/jquery-ui/effect-blind.js} +21 -13
  103. data/{vendor/assets/javascripts/jquery.ui.effect-bounce.js → app/assets/javascripts/jquery-ui/effect-bounce.js} +19 -9
  104. data/{vendor/assets/javascripts/jquery.ui.effect-clip.js → app/assets/javascripts/jquery-ui/effect-clip.js} +19 -9
  105. data/{vendor/assets/javascripts/jquery.ui.effect-drop.js → app/assets/javascripts/jquery-ui/effect-drop.js} +20 -10
  106. data/{vendor/assets/javascripts/jquery.ui.effect-explode.js → app/assets/javascripts/jquery-ui/effect-explode.js} +21 -11
  107. data/app/assets/javascripts/jquery-ui/effect-fade.js +42 -0
  108. data/{vendor/assets/javascripts/jquery.ui.effect-fold.js → app/assets/javascripts/jquery-ui/effect-fold.js} +19 -9
  109. data/{vendor/assets/javascripts/jquery.ui.effect-highlight.js → app/assets/javascripts/jquery-ui/effect-highlight.js} +19 -9
  110. data/app/assets/javascripts/jquery-ui/effect-puff.js +63 -0
  111. data/{vendor/assets/javascripts/jquery.ui.effect-pulsate.js → app/assets/javascripts/jquery-ui/effect-pulsate.js} +19 -9
  112. data/app/assets/javascripts/jquery-ui/effect-scale.js +92 -0
  113. data/{vendor/assets/javascripts/jquery.ui.effect-shake.js → app/assets/javascripts/jquery-ui/effect-shake.js} +20 -10
  114. data/{vendor/assets/javascripts/jquery.ui.effect-scale.js → app/assets/javascripts/jquery-ui/effect-size.js} +20 -105
  115. data/{vendor/assets/javascripts/jquery.ui.effect-slide.js → app/assets/javascripts/jquery-ui/effect-slide.js} +19 -9
  116. data/{vendor/assets/javascripts/jquery.ui.effect-transfer.js → app/assets/javascripts/jquery-ui/effect-transfer.js} +23 -13
  117. data/app/assets/javascripts/jquery-ui/effect.all.js +16 -0
  118. data/{vendor/assets/javascripts/jquery.ui.effect.js → app/assets/javascripts/jquery-ui/effect.js} +125 -92
  119. data/{vendor/assets/javascripts/jquery.ui.menu.js → app/assets/javascripts/jquery-ui/menu.js} +127 -102
  120. data/{vendor/assets/javascripts/jquery.ui.mouse.js → app/assets/javascripts/jquery-ui/mouse.js} +57 -27
  121. data/{vendor/assets/javascripts/jquery.ui.position.js → app/assets/javascripts/jquery-ui/position.js} +47 -27
  122. data/{vendor/assets/javascripts/jquery.ui.progressbar.js → app/assets/javascripts/jquery-ui/progressbar.js} +27 -13
  123. data/{vendor/assets/javascripts/jquery.ui.resizable.js → app/assets/javascripts/jquery-ui/resizable.js} +454 -243
  124. data/{vendor/assets/javascripts/jquery.ui.selectable.js → app/assets/javascripts/jquery-ui/selectable.js} +26 -16
  125. data/app/assets/javascripts/jquery-ui/selectmenu.js +620 -0
  126. data/{vendor/assets/javascripts/jquery.ui.slider.js → app/assets/javascripts/jquery-ui/slider.js} +159 -91
  127. data/{vendor/assets/javascripts/jquery.ui.sortable.js → app/assets/javascripts/jquery-ui/sortable.js} +168 -114
  128. data/{vendor/assets/javascripts/jquery.ui.spinner.js → app/assets/javascripts/jquery-ui/spinner.js} +54 -32
  129. data/{vendor/assets/javascripts/jquery.ui.tabs.js → app/assets/javascripts/jquery-ui/tabs.js} +108 -73
  130. data/{vendor/assets/javascripts/jquery.ui.tooltip.js → app/assets/javascripts/jquery-ui/tooltip.js} +134 -75
  131. data/{vendor/assets/javascripts/jquery.ui.widget.js → app/assets/javascripts/jquery-ui/widget.js} +81 -44
  132. data/app/assets/javascripts/jquery-ui.js +37 -0
  133. data/{vendor/assets/stylesheets/jquery.ui.accordion.css.erb → app/assets/stylesheets/jquery-ui/accordion.css} +7 -9
  134. data/app/assets/stylesheets/jquery-ui/all.css +14 -0
  135. data/app/assets/stylesheets/jquery-ui/autocomplete.css +21 -0
  136. data/app/assets/stylesheets/jquery-ui/base.css +30 -0
  137. data/{vendor/assets/stylesheets/jquery.ui.button.css.erb → app/assets/stylesheets/jquery-ui/button.css} +5 -5
  138. data/{vendor/assets/stylesheets/jquery.ui.core.css.erb → app/assets/stylesheets/jquery-ui/core.css} +8 -4
  139. data/{vendor/assets/stylesheets/jquery.ui.datepicker.css.erb → app/assets/stylesheets/jquery-ui/datepicker.css} +6 -9
  140. data/{vendor/assets/stylesheets/jquery.ui.dialog.css.erb → app/assets/stylesheets/jquery-ui/dialog.css} +10 -8
  141. data/app/assets/stylesheets/jquery-ui/draggable.css +16 -0
  142. data/app/assets/stylesheets/jquery-ui/menu.css +67 -0
  143. data/app/assets/stylesheets/jquery-ui/progressbar.css +32 -0
  144. data/{vendor/assets/stylesheets/jquery.ui.resizable.css.erb → app/assets/stylesheets/jquery-ui/resizable.css} +6 -6
  145. data/app/assets/stylesheets/jquery-ui/selectable.css +21 -0
  146. data/app/assets/stylesheets/jquery-ui/selectmenu.css +64 -0
  147. data/{vendor/assets/stylesheets/jquery.ui.slider.css.erb → app/assets/stylesheets/jquery-ui/slider.css} +8 -6
  148. data/app/assets/stylesheets/jquery-ui/sortable.css +16 -0
  149. data/{vendor/assets/stylesheets/jquery.ui.spinner.css.erb → app/assets/stylesheets/jquery-ui/spinner.css} +8 -8
  150. data/{vendor/assets/stylesheets/jquery.ui.tabs.css.erb → app/assets/stylesheets/jquery-ui/tabs.css} +11 -12
  151. data/{vendor/assets/stylesheets/jquery.ui.theme.css.erb → app/assets/stylesheets/jquery-ui/theme.css.erb} +29 -11
  152. data/{vendor/assets/stylesheets/jquery.ui.tooltip.css.erb → app/assets/stylesheets/jquery-ui/tooltip.css} +6 -4
  153. data/app/assets/stylesheets/jquery-ui.css +1 -0
  154. data/lib/jquery/ui/rails/version.rb +2 -1
  155. metadata +155 -161
  156. data/vendor/assets/javascripts/jquery.ui.all.js +0 -34
  157. data/vendor/assets/javascripts/jquery.ui.datepicker-af.js +0 -23
  158. data/vendor/assets/javascripts/jquery.ui.datepicker-ar-DZ.js +0 -23
  159. data/vendor/assets/javascripts/jquery.ui.datepicker-ar.js +0 -23
  160. data/vendor/assets/javascripts/jquery.ui.datepicker-az.js +0 -23
  161. data/vendor/assets/javascripts/jquery.ui.datepicker-be.js +0 -23
  162. data/vendor/assets/javascripts/jquery.ui.datepicker-bg.js +0 -24
  163. data/vendor/assets/javascripts/jquery.ui.datepicker-bs.js +0 -23
  164. data/vendor/assets/javascripts/jquery.ui.datepicker-ca.js +0 -23
  165. data/vendor/assets/javascripts/jquery.ui.datepicker-cs.js +0 -23
  166. data/vendor/assets/javascripts/jquery.ui.datepicker-cy-GB.js +0 -23
  167. data/vendor/assets/javascripts/jquery.ui.datepicker-da.js +0 -23
  168. data/vendor/assets/javascripts/jquery.ui.datepicker-de.js +0 -23
  169. data/vendor/assets/javascripts/jquery.ui.datepicker-el.js +0 -23
  170. data/vendor/assets/javascripts/jquery.ui.datepicker-en-AU.js +0 -23
  171. data/vendor/assets/javascripts/jquery.ui.datepicker-en-GB.js +0 -23
  172. data/vendor/assets/javascripts/jquery.ui.datepicker-en-NZ.js +0 -23
  173. data/vendor/assets/javascripts/jquery.ui.datepicker-eo.js +0 -23
  174. data/vendor/assets/javascripts/jquery.ui.datepicker-es.js +0 -23
  175. data/vendor/assets/javascripts/jquery.ui.datepicker-et.js +0 -23
  176. data/vendor/assets/javascripts/jquery.ui.datepicker-eu.js +0 -23
  177. data/vendor/assets/javascripts/jquery.ui.datepicker-fa.js +0 -59
  178. data/vendor/assets/javascripts/jquery.ui.datepicker-fi.js +0 -23
  179. data/vendor/assets/javascripts/jquery.ui.datepicker-fo.js +0 -23
  180. data/vendor/assets/javascripts/jquery.ui.datepicker-fr-CA.js +0 -23
  181. data/vendor/assets/javascripts/jquery.ui.datepicker-fr-CH.js +0 -23
  182. data/vendor/assets/javascripts/jquery.ui.datepicker-fr.js +0 -25
  183. data/vendor/assets/javascripts/jquery.ui.datepicker-gl.js +0 -23
  184. data/vendor/assets/javascripts/jquery.ui.datepicker-he.js +0 -23
  185. data/vendor/assets/javascripts/jquery.ui.datepicker-hi.js +0 -23
  186. data/vendor/assets/javascripts/jquery.ui.datepicker-hr.js +0 -23
  187. data/vendor/assets/javascripts/jquery.ui.datepicker-hu.js +0 -23
  188. data/vendor/assets/javascripts/jquery.ui.datepicker-hy.js +0 -23
  189. data/vendor/assets/javascripts/jquery.ui.datepicker-id.js +0 -23
  190. data/vendor/assets/javascripts/jquery.ui.datepicker-is.js +0 -23
  191. data/vendor/assets/javascripts/jquery.ui.datepicker-it.js +0 -23
  192. data/vendor/assets/javascripts/jquery.ui.datepicker-ja.js +0 -23
  193. data/vendor/assets/javascripts/jquery.ui.datepicker-ka.js +0 -21
  194. data/vendor/assets/javascripts/jquery.ui.datepicker-kk.js +0 -23
  195. data/vendor/assets/javascripts/jquery.ui.datepicker-km.js +0 -23
  196. data/vendor/assets/javascripts/jquery.ui.datepicker-ko.js +0 -23
  197. data/vendor/assets/javascripts/jquery.ui.datepicker-ky.js +0 -24
  198. data/vendor/assets/javascripts/jquery.ui.datepicker-lb.js +0 -23
  199. data/vendor/assets/javascripts/jquery.ui.datepicker-lt.js +0 -23
  200. data/vendor/assets/javascripts/jquery.ui.datepicker-lv.js +0 -23
  201. data/vendor/assets/javascripts/jquery.ui.datepicker-mk.js +0 -23
  202. data/vendor/assets/javascripts/jquery.ui.datepicker-ml.js +0 -23
  203. data/vendor/assets/javascripts/jquery.ui.datepicker-ms.js +0 -23
  204. data/vendor/assets/javascripts/jquery.ui.datepicker-nb.js +0 -22
  205. data/vendor/assets/javascripts/jquery.ui.datepicker-nl-BE.js +0 -23
  206. data/vendor/assets/javascripts/jquery.ui.datepicker-nl.js +0 -23
  207. data/vendor/assets/javascripts/jquery.ui.datepicker-nn.js +0 -22
  208. data/vendor/assets/javascripts/jquery.ui.datepicker-no.js +0 -23
  209. data/vendor/assets/javascripts/jquery.ui.datepicker-pl.js +0 -23
  210. data/vendor/assets/javascripts/jquery.ui.datepicker-pt-BR.js +0 -23
  211. data/vendor/assets/javascripts/jquery.ui.datepicker-pt.js +0 -22
  212. data/vendor/assets/javascripts/jquery.ui.datepicker-rm.js +0 -21
  213. data/vendor/assets/javascripts/jquery.ui.datepicker-ro.js +0 -26
  214. data/vendor/assets/javascripts/jquery.ui.datepicker-ru.js +0 -23
  215. data/vendor/assets/javascripts/jquery.ui.datepicker-sk.js +0 -23
  216. data/vendor/assets/javascripts/jquery.ui.datepicker-sl.js +0 -24
  217. data/vendor/assets/javascripts/jquery.ui.datepicker-sq.js +0 -23
  218. data/vendor/assets/javascripts/jquery.ui.datepicker-sr-SR.js +0 -23
  219. data/vendor/assets/javascripts/jquery.ui.datepicker-sr.js +0 -23
  220. data/vendor/assets/javascripts/jquery.ui.datepicker-sv.js +0 -23
  221. data/vendor/assets/javascripts/jquery.ui.datepicker-ta.js +0 -23
  222. data/vendor/assets/javascripts/jquery.ui.datepicker-th.js +0 -23
  223. data/vendor/assets/javascripts/jquery.ui.datepicker-tj.js +0 -23
  224. data/vendor/assets/javascripts/jquery.ui.datepicker-tr.js +0 -23
  225. data/vendor/assets/javascripts/jquery.ui.datepicker-uk.js +0 -24
  226. data/vendor/assets/javascripts/jquery.ui.datepicker-vi.js +0 -23
  227. data/vendor/assets/javascripts/jquery.ui.datepicker-zh-CN.js +0 -23
  228. data/vendor/assets/javascripts/jquery.ui.datepicker-zh-HK.js +0 -23
  229. data/vendor/assets/javascripts/jquery.ui.datepicker-zh-TW.js +0 -23
  230. data/vendor/assets/javascripts/jquery.ui.draggable.js +0 -950
  231. data/vendor/assets/javascripts/jquery.ui.droppable.js +0 -376
  232. data/vendor/assets/javascripts/jquery.ui.effect-fade.js +0 -32
  233. data/vendor/assets/javascripts/jquery.ui.effect.all.js +0 -14
  234. data/vendor/assets/stylesheets/jquery.ui.all.css.erb +0 -14
  235. data/vendor/assets/stylesheets/jquery.ui.autocomplete.css.erb +0 -21
  236. data/vendor/assets/stylesheets/jquery.ui.base.css.erb +0 -27
  237. data/vendor/assets/stylesheets/jquery.ui.menu.css.erb +0 -81
  238. data/vendor/assets/stylesheets/jquery.ui.progressbar.css.erb +0 -32
  239. data/vendor/assets/stylesheets/jquery.ui.selectable.css.erb +0 -19
@@ -1,950 +0,0 @@
1
- //= require jquery.ui.core
2
- //= require jquery.ui.widget
3
- //= require jquery.ui.mouse
4
-
5
- /*!
6
- * jQuery UI Draggable 1.10.0
7
- * http://jqueryui.com
8
- *
9
- * Copyright 2013 jQuery Foundation and other contributors
10
- * Released under the MIT license.
11
- * http://jquery.org/license
12
- *
13
- * http://api.jqueryui.com/draggable/
14
- *
15
- * Depends:
16
- * jquery.ui.core.js
17
- * jquery.ui.mouse.js
18
- * jquery.ui.widget.js
19
- */
20
- (function( $, undefined ) {
21
-
22
- $.widget("ui.draggable", $.ui.mouse, {
23
- version: "1.10.0",
24
- widgetEventPrefix: "drag",
25
- options: {
26
- addClasses: true,
27
- appendTo: "parent",
28
- axis: false,
29
- connectToSortable: false,
30
- containment: false,
31
- cursor: "auto",
32
- cursorAt: false,
33
- grid: false,
34
- handle: false,
35
- helper: "original",
36
- iframeFix: false,
37
- opacity: false,
38
- refreshPositions: false,
39
- revert: false,
40
- revertDuration: 500,
41
- scope: "default",
42
- scroll: true,
43
- scrollSensitivity: 20,
44
- scrollSpeed: 20,
45
- snap: false,
46
- snapMode: "both",
47
- snapTolerance: 20,
48
- stack: false,
49
- zIndex: false,
50
-
51
- // callbacks
52
- drag: null,
53
- start: null,
54
- stop: null
55
- },
56
- _create: function() {
57
-
58
- if (this.options.helper === "original" && !(/^(?:r|a|f)/).test(this.element.css("position"))) {
59
- this.element[0].style.position = "relative";
60
- }
61
- if (this.options.addClasses){
62
- this.element.addClass("ui-draggable");
63
- }
64
- if (this.options.disabled){
65
- this.element.addClass("ui-draggable-disabled");
66
- }
67
-
68
- this._mouseInit();
69
-
70
- },
71
-
72
- _destroy: function() {
73
- this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
74
- this._mouseDestroy();
75
- },
76
-
77
- _mouseCapture: function(event) {
78
-
79
- var o = this.options;
80
-
81
- // among others, prevent a drag on a resizable-handle
82
- if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
83
- return false;
84
- }
85
-
86
- //Quit if we're not on a valid handle
87
- this.handle = this._getHandle(event);
88
- if (!this.handle) {
89
- return false;
90
- }
91
-
92
- $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
93
- $("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>")
94
- .css({
95
- width: this.offsetWidth+"px", height: this.offsetHeight+"px",
96
- position: "absolute", opacity: "0.001", zIndex: 1000
97
- })
98
- .css($(this).offset())
99
- .appendTo("body");
100
- });
101
-
102
- return true;
103
-
104
- },
105
-
106
- _mouseStart: function(event) {
107
-
108
- var o = this.options;
109
-
110
- //Create and append the visible helper
111
- this.helper = this._createHelper(event);
112
-
113
- this.helper.addClass("ui-draggable-dragging");
114
-
115
- //Cache the helper size
116
- this._cacheHelperProportions();
117
-
118
- //If ddmanager is used for droppables, set the global draggable
119
- if($.ui.ddmanager) {
120
- $.ui.ddmanager.current = this;
121
- }
122
-
123
- /*
124
- * - Position generation -
125
- * This block generates everything position related - it's the core of draggables.
126
- */
127
-
128
- //Cache the margins of the original element
129
- this._cacheMargins();
130
-
131
- //Store the helper's css position
132
- this.cssPosition = this.helper.css("position");
133
- this.scrollParent = this.helper.scrollParent();
134
-
135
- //The element's absolute position on the page minus margins
136
- this.offset = this.positionAbs = this.element.offset();
137
- this.offset = {
138
- top: this.offset.top - this.margins.top,
139
- left: this.offset.left - this.margins.left
140
- };
141
-
142
- $.extend(this.offset, {
143
- click: { //Where the click happened, relative to the element
144
- left: event.pageX - this.offset.left,
145
- top: event.pageY - this.offset.top
146
- },
147
- parent: this._getParentOffset(),
148
- relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
149
- });
150
-
151
- //Generate the original position
152
- this.originalPosition = this.position = this._generatePosition(event);
153
- this.originalPageX = event.pageX;
154
- this.originalPageY = event.pageY;
155
-
156
- //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
157
- (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
158
-
159
- //Set a containment if given in the options
160
- if(o.containment) {
161
- this._setContainment();
162
- }
163
-
164
- //Trigger event + callbacks
165
- if(this._trigger("start", event) === false) {
166
- this._clear();
167
- return false;
168
- }
169
-
170
- //Recache the helper size
171
- this._cacheHelperProportions();
172
-
173
- //Prepare the droppable offsets
174
- if ($.ui.ddmanager && !o.dropBehaviour) {
175
- $.ui.ddmanager.prepareOffsets(this, event);
176
- }
177
-
178
-
179
- this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
180
-
181
- //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
182
- if ( $.ui.ddmanager ) {
183
- $.ui.ddmanager.dragStart(this, event);
184
- }
185
-
186
- return true;
187
- },
188
-
189
- _mouseDrag: function(event, noPropagation) {
190
-
191
- //Compute the helpers position
192
- this.position = this._generatePosition(event);
193
- this.positionAbs = this._convertPositionTo("absolute");
194
-
195
- //Call plugins and callbacks and use the resulting position if something is returned
196
- if (!noPropagation) {
197
- var ui = this._uiHash();
198
- if(this._trigger("drag", event, ui) === false) {
199
- this._mouseUp({});
200
- return false;
201
- }
202
- this.position = ui.position;
203
- }
204
-
205
- if(!this.options.axis || this.options.axis !== "y") {
206
- this.helper[0].style.left = this.position.left+"px";
207
- }
208
- if(!this.options.axis || this.options.axis !== "x") {
209
- this.helper[0].style.top = this.position.top+"px";
210
- }
211
- if($.ui.ddmanager) {
212
- $.ui.ddmanager.drag(this, event);
213
- }
214
-
215
- return false;
216
- },
217
-
218
- _mouseStop: function(event) {
219
-
220
- //If we are using droppables, inform the manager about the drop
221
- var element,
222
- that = this,
223
- elementInDom = false,
224
- dropped = false;
225
- if ($.ui.ddmanager && !this.options.dropBehaviour) {
226
- dropped = $.ui.ddmanager.drop(this, event);
227
- }
228
-
229
- //if a drop comes from outside (a sortable)
230
- if(this.dropped) {
231
- dropped = this.dropped;
232
- this.dropped = false;
233
- }
234
-
235
- //if the original element is no longer in the DOM don't bother to continue (see #8269)
236
- element = this.element[0];
237
- while ( element && (element = element.parentNode) ) {
238
- if (element === document ) {
239
- elementInDom = true;
240
- }
241
- }
242
- if ( !elementInDom && this.options.helper === "original" ) {
243
- return false;
244
- }
245
-
246
- if((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
247
- $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
248
- if(that._trigger("stop", event) !== false) {
249
- that._clear();
250
- }
251
- });
252
- } else {
253
- if(this._trigger("stop", event) !== false) {
254
- this._clear();
255
- }
256
- }
257
-
258
- return false;
259
- },
260
-
261
- _mouseUp: function(event) {
262
- //Remove frame helpers
263
- $("div.ui-draggable-iframeFix").each(function() {
264
- this.parentNode.removeChild(this);
265
- });
266
-
267
- //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
268
- if( $.ui.ddmanager ) {
269
- $.ui.ddmanager.dragStop(this, event);
270
- }
271
-
272
- return $.ui.mouse.prototype._mouseUp.call(this, event);
273
- },
274
-
275
- cancel: function() {
276
-
277
- if(this.helper.is(".ui-draggable-dragging")) {
278
- this._mouseUp({});
279
- } else {
280
- this._clear();
281
- }
282
-
283
- return this;
284
-
285
- },
286
-
287
- _getHandle: function(event) {
288
-
289
- var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
290
- $(this.options.handle, this.element)
291
- .find("*")
292
- .addBack()
293
- .each(function() {
294
- if(this === event.target) {
295
- handle = true;
296
- }
297
- });
298
-
299
- return handle;
300
-
301
- },
302
-
303
- _createHelper: function(event) {
304
-
305
- var o = this.options,
306
- helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper === "clone" ? this.element.clone().removeAttr("id") : this.element);
307
-
308
- if(!helper.parents("body").length) {
309
- helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
310
- }
311
-
312
- if(helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
313
- helper.css("position", "absolute");
314
- }
315
-
316
- return helper;
317
-
318
- },
319
-
320
- _adjustOffsetFromHelper: function(obj) {
321
- if (typeof obj === "string") {
322
- obj = obj.split(" ");
323
- }
324
- if ($.isArray(obj)) {
325
- obj = {left: +obj[0], top: +obj[1] || 0};
326
- }
327
- if ("left" in obj) {
328
- this.offset.click.left = obj.left + this.margins.left;
329
- }
330
- if ("right" in obj) {
331
- this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
332
- }
333
- if ("top" in obj) {
334
- this.offset.click.top = obj.top + this.margins.top;
335
- }
336
- if ("bottom" in obj) {
337
- this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
338
- }
339
- },
340
-
341
- _getParentOffset: function() {
342
-
343
- //Get the offsetParent and cache its position
344
- this.offsetParent = this.helper.offsetParent();
345
- var po = this.offsetParent.offset();
346
-
347
- // This is a special case where we need to modify a offset calculated on start, since the following happened:
348
- // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
349
- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
350
- // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
351
- if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
352
- po.left += this.scrollParent.scrollLeft();
353
- po.top += this.scrollParent.scrollTop();
354
- }
355
-
356
- //This needs to be actually done for all browsers, since pageX/pageY includes this information
357
- //Ugly IE fix
358
- if((this.offsetParent[0] === document.body) ||
359
- (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
360
- po = { top: 0, left: 0 };
361
- }
362
-
363
- return {
364
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
365
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
366
- };
367
-
368
- },
369
-
370
- _getRelativeOffset: function() {
371
-
372
- if(this.cssPosition === "relative") {
373
- var p = this.element.position();
374
- return {
375
- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
376
- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
377
- };
378
- } else {
379
- return { top: 0, left: 0 };
380
- }
381
-
382
- },
383
-
384
- _cacheMargins: function() {
385
- this.margins = {
386
- left: (parseInt(this.element.css("marginLeft"),10) || 0),
387
- top: (parseInt(this.element.css("marginTop"),10) || 0),
388
- right: (parseInt(this.element.css("marginRight"),10) || 0),
389
- bottom: (parseInt(this.element.css("marginBottom"),10) || 0)
390
- };
391
- },
392
-
393
- _cacheHelperProportions: function() {
394
- this.helperProportions = {
395
- width: this.helper.outerWidth(),
396
- height: this.helper.outerHeight()
397
- };
398
- },
399
-
400
- _setContainment: function() {
401
-
402
- var over, c, ce,
403
- o = this.options;
404
-
405
- if(o.containment === "parent") {
406
- o.containment = this.helper[0].parentNode;
407
- }
408
- if(o.containment === "document" || o.containment === "window") {
409
- this.containment = [
410
- o.containment === "document" ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
411
- o.containment === "document" ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top,
412
- (o.containment === "document" ? 0 : $(window).scrollLeft()) + $(o.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left,
413
- (o.containment === "document" ? 0 : $(window).scrollTop()) + ($(o.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
414
- ];
415
- }
416
-
417
- if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor !== Array) {
418
- c = $(o.containment);
419
- ce = c[0];
420
-
421
- if(!ce) {
422
- return;
423
- }
424
-
425
- over = ($(ce).css("overflow") !== "hidden");
426
-
427
- this.containment = [
428
- (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0),
429
- (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0),
430
- (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right,
431
- (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom
432
- ];
433
- this.relative_container = c;
434
-
435
- } else if(o.containment.constructor === Array) {
436
- this.containment = o.containment;
437
- }
438
-
439
- },
440
-
441
- _convertPositionTo: function(d, pos) {
442
-
443
- if(!pos) {
444
- pos = this.position;
445
- }
446
-
447
- var mod = d === "absolute" ? 1 : -1,
448
- scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
449
-
450
- return {
451
- top: (
452
- pos.top + // The absolute mouse position
453
- this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
454
- this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)
455
- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
456
- ),
457
- left: (
458
- pos.left + // The absolute mouse position
459
- this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
460
- this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)
461
- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
462
- )
463
- };
464
-
465
- },
466
-
467
- _generatePosition: function(event) {
468
-
469
- var containment, co, top, left,
470
- o = this.options,
471
- scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
472
- scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName),
473
- pageX = event.pageX,
474
- pageY = event.pageY;
475
-
476
- /*
477
- * - Position constraining -
478
- * Constrain the position to a mix of grid, containment.
479
- */
480
-
481
- if(this.originalPosition) { //If we are not dragging yet, we won't check for options
482
- if(this.containment) {
483
- if (this.relative_container){
484
- co = this.relative_container.offset();
485
- containment = [ this.containment[0] + co.left,
486
- this.containment[1] + co.top,
487
- this.containment[2] + co.left,
488
- this.containment[3] + co.top ];
489
- }
490
- else {
491
- containment = this.containment;
492
- }
493
-
494
- if(event.pageX - this.offset.click.left < containment[0]) {
495
- pageX = containment[0] + this.offset.click.left;
496
- }
497
- if(event.pageY - this.offset.click.top < containment[1]) {
498
- pageY = containment[1] + this.offset.click.top;
499
- }
500
- if(event.pageX - this.offset.click.left > containment[2]) {
501
- pageX = containment[2] + this.offset.click.left;
502
- }
503
- if(event.pageY - this.offset.click.top > containment[3]) {
504
- pageY = containment[3] + this.offset.click.top;
505
- }
506
- }
507
-
508
- if(o.grid) {
509
- //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
510
- top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
511
- pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
512
-
513
- left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
514
- pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
515
- }
516
-
517
- }
518
-
519
- return {
520
- top: (
521
- pageY - // The absolute mouse position
522
- this.offset.click.top - // Click offset (relative to the element)
523
- this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent
524
- this.offset.parent.top + // The offsetParent's offset without borders (offset + border)
525
- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
526
- ),
527
- left: (
528
- pageX - // The absolute mouse position
529
- this.offset.click.left - // Click offset (relative to the element)
530
- this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent
531
- this.offset.parent.left + // The offsetParent's offset without borders (offset + border)
532
- ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
533
- )
534
- };
535
-
536
- },
537
-
538
- _clear: function() {
539
- this.helper.removeClass("ui-draggable-dragging");
540
- if(this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
541
- this.helper.remove();
542
- }
543
- this.helper = null;
544
- this.cancelHelperRemoval = false;
545
- },
546
-
547
- // From now on bulk stuff - mainly helpers
548
-
549
- _trigger: function(type, event, ui) {
550
- ui = ui || this._uiHash();
551
- $.ui.plugin.call(this, type, [event, ui]);
552
- //The absolute position has to be recalculated after plugins
553
- if(type === "drag") {
554
- this.positionAbs = this._convertPositionTo("absolute");
555
- }
556
- return $.Widget.prototype._trigger.call(this, type, event, ui);
557
- },
558
-
559
- plugins: {},
560
-
561
- _uiHash: function() {
562
- return {
563
- helper: this.helper,
564
- position: this.position,
565
- originalPosition: this.originalPosition,
566
- offset: this.positionAbs
567
- };
568
- }
569
-
570
- });
571
-
572
- $.ui.plugin.add("draggable", "connectToSortable", {
573
- start: function(event, ui) {
574
-
575
- var inst = $(this).data("ui-draggable"), o = inst.options,
576
- uiSortable = $.extend({}, ui, { item: inst.element });
577
- inst.sortables = [];
578
- $(o.connectToSortable).each(function() {
579
- var sortable = $.data(this, "ui-sortable");
580
- if (sortable && !sortable.options.disabled) {
581
- inst.sortables.push({
582
- instance: sortable,
583
- shouldRevert: sortable.options.revert
584
- });
585
- sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page).
586
- sortable._trigger("activate", event, uiSortable);
587
- }
588
- });
589
-
590
- },
591
- stop: function(event, ui) {
592
-
593
- //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
594
- var inst = $(this).data("ui-draggable"),
595
- uiSortable = $.extend({}, ui, { item: inst.element });
596
-
597
- $.each(inst.sortables, function() {
598
- if(this.instance.isOver) {
599
-
600
- this.instance.isOver = 0;
601
-
602
- inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
603
- this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
604
-
605
- //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: "valid/invalid"
606
- if(this.shouldRevert) {
607
- this.instance.options.revert = true;
608
- }
609
-
610
- //Trigger the stop of the sortable
611
- this.instance._mouseStop(event);
612
-
613
- this.instance.options.helper = this.instance.options._helper;
614
-
615
- //If the helper has been the original item, restore properties in the sortable
616
- if(inst.options.helper === "original") {
617
- this.instance.currentItem.css({ top: "auto", left: "auto" });
618
- }
619
-
620
- } else {
621
- this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
622
- this.instance._trigger("deactivate", event, uiSortable);
623
- }
624
-
625
- });
626
-
627
- },
628
- drag: function(event, ui) {
629
-
630
- var inst = $(this).data("ui-draggable"), that = this;
631
-
632
- $.each(inst.sortables, function() {
633
-
634
- var innermostIntersecting = false,
635
- thisSortable = this;
636
-
637
- //Copy over some variables to allow calling the sortable's native _intersectsWith
638
- this.instance.positionAbs = inst.positionAbs;
639
- this.instance.helperProportions = inst.helperProportions;
640
- this.instance.offset.click = inst.offset.click;
641
-
642
- if(this.instance._intersectsWith(this.instance.containerCache)) {
643
- innermostIntersecting = true;
644
- $.each(inst.sortables, function () {
645
- this.instance.positionAbs = inst.positionAbs;
646
- this.instance.helperProportions = inst.helperProportions;
647
- this.instance.offset.click = inst.offset.click;
648
- if (this !== thisSortable &&
649
- this.instance._intersectsWith(this.instance.containerCache) &&
650
- $.ui.contains(thisSortable.instance.element[0], this.instance.element[0])
651
- ) {
652
- innermostIntersecting = false;
653
- }
654
- return innermostIntersecting;
655
- });
656
- }
657
-
658
-
659
- if(innermostIntersecting) {
660
- //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
661
- if(!this.instance.isOver) {
662
-
663
- this.instance.isOver = 1;
664
- //Now we fake the start of dragging for the sortable instance,
665
- //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
666
- //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
667
- this.instance.currentItem = $(that).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item", true);
668
- this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
669
- this.instance.options.helper = function() { return ui.helper[0]; };
670
-
671
- event.target = this.instance.currentItem[0];
672
- this.instance._mouseCapture(event, true);
673
- this.instance._mouseStart(event, true, true);
674
-
675
- //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
676
- this.instance.offset.click.top = inst.offset.click.top;
677
- this.instance.offset.click.left = inst.offset.click.left;
678
- this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
679
- this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
680
-
681
- inst._trigger("toSortable", event);
682
- inst.dropped = this.instance.element; //draggable revert needs that
683
- //hack so receive/update callbacks work (mostly)
684
- inst.currentItem = inst.element;
685
- this.instance.fromOutside = inst;
686
-
687
- }
688
-
689
- //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
690
- if(this.instance.currentItem) {
691
- this.instance._mouseDrag(event);
692
- }
693
-
694
- } else {
695
-
696
- //If it doesn't intersect with the sortable, and it intersected before,
697
- //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
698
- if(this.instance.isOver) {
699
-
700
- this.instance.isOver = 0;
701
- this.instance.cancelHelperRemoval = true;
702
-
703
- //Prevent reverting on this forced stop
704
- this.instance.options.revert = false;
705
-
706
- // The out event needs to be triggered independently
707
- this.instance._trigger("out", event, this.instance._uiHash(this.instance));
708
-
709
- this.instance._mouseStop(event, true);
710
- this.instance.options.helper = this.instance.options._helper;
711
-
712
- //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
713
- this.instance.currentItem.remove();
714
- if(this.instance.placeholder) {
715
- this.instance.placeholder.remove();
716
- }
717
-
718
- inst._trigger("fromSortable", event);
719
- inst.dropped = false; //draggable revert needs that
720
- }
721
-
722
- }
723
-
724
- });
725
-
726
- }
727
- });
728
-
729
- $.ui.plugin.add("draggable", "cursor", {
730
- start: function() {
731
- var t = $("body"), o = $(this).data("ui-draggable").options;
732
- if (t.css("cursor")) {
733
- o._cursor = t.css("cursor");
734
- }
735
- t.css("cursor", o.cursor);
736
- },
737
- stop: function() {
738
- var o = $(this).data("ui-draggable").options;
739
- if (o._cursor) {
740
- $("body").css("cursor", o._cursor);
741
- }
742
- }
743
- });
744
-
745
- $.ui.plugin.add("draggable", "opacity", {
746
- start: function(event, ui) {
747
- var t = $(ui.helper), o = $(this).data("ui-draggable").options;
748
- if(t.css("opacity")) {
749
- o._opacity = t.css("opacity");
750
- }
751
- t.css("opacity", o.opacity);
752
- },
753
- stop: function(event, ui) {
754
- var o = $(this).data("ui-draggable").options;
755
- if(o._opacity) {
756
- $(ui.helper).css("opacity", o._opacity);
757
- }
758
- }
759
- });
760
-
761
- $.ui.plugin.add("draggable", "scroll", {
762
- start: function() {
763
- var i = $(this).data("ui-draggable");
764
- if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
765
- i.overflowOffset = i.scrollParent.offset();
766
- }
767
- },
768
- drag: function( event ) {
769
-
770
- var i = $(this).data("ui-draggable"), o = i.options, scrolled = false;
771
-
772
- if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
773
-
774
- if(!o.axis || o.axis !== "x") {
775
- if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
776
- i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
777
- } else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) {
778
- i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
779
- }
780
- }
781
-
782
- if(!o.axis || o.axis !== "y") {
783
- if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
784
- i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
785
- } else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) {
786
- i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
787
- }
788
- }
789
-
790
- } else {
791
-
792
- if(!o.axis || o.axis !== "x") {
793
- if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
794
- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
795
- } else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
796
- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
797
- }
798
- }
799
-
800
- if(!o.axis || o.axis !== "y") {
801
- if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
802
- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
803
- } else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
804
- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
805
- }
806
- }
807
-
808
- }
809
-
810
- if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
811
- $.ui.ddmanager.prepareOffsets(i, event);
812
- }
813
-
814
- }
815
- });
816
-
817
- $.ui.plugin.add("draggable", "snap", {
818
- start: function() {
819
-
820
- var i = $(this).data("ui-draggable"),
821
- o = i.options;
822
-
823
- i.snapElements = [];
824
-
825
- $(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
826
- var $t = $(this),
827
- $o = $t.offset();
828
- if(this !== i.element[0]) {
829
- i.snapElements.push({
830
- item: this,
831
- width: $t.outerWidth(), height: $t.outerHeight(),
832
- top: $o.top, left: $o.left
833
- });
834
- }
835
- });
836
-
837
- },
838
- drag: function(event, ui) {
839
-
840
- var ts, bs, ls, rs, l, r, t, b, i, first,
841
- inst = $(this).data("ui-draggable"),
842
- o = inst.options,
843
- d = o.snapTolerance,
844
- x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
845
- y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
846
-
847
- for (i = inst.snapElements.length - 1; i >= 0; i--){
848
-
849
- l = inst.snapElements[i].left;
850
- r = l + inst.snapElements[i].width;
851
- t = inst.snapElements[i].top;
852
- b = t + inst.snapElements[i].height;
853
-
854
- //Yes, I know, this is insane ;)
855
- if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
856
- if(inst.snapElements[i].snapping) {
857
- (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
858
- }
859
- inst.snapElements[i].snapping = false;
860
- continue;
861
- }
862
-
863
- if(o.snapMode !== "inner") {
864
- ts = Math.abs(t - y2) <= d;
865
- bs = Math.abs(b - y1) <= d;
866
- ls = Math.abs(l - x2) <= d;
867
- rs = Math.abs(r - x1) <= d;
868
- if(ts) {
869
- ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
870
- }
871
- if(bs) {
872
- ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
873
- }
874
- if(ls) {
875
- ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
876
- }
877
- if(rs) {
878
- ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
879
- }
880
- }
881
-
882
- first = (ts || bs || ls || rs);
883
-
884
- if(o.snapMode !== "outer") {
885
- ts = Math.abs(t - y1) <= d;
886
- bs = Math.abs(b - y2) <= d;
887
- ls = Math.abs(l - x1) <= d;
888
- rs = Math.abs(r - x2) <= d;
889
- if(ts) {
890
- ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
891
- }
892
- if(bs) {
893
- ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
894
- }
895
- if(ls) {
896
- ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
897
- }
898
- if(rs) {
899
- ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
900
- }
901
- }
902
-
903
- if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
904
- (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
905
- }
906
- inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
907
-
908
- }
909
-
910
- }
911
- });
912
-
913
- $.ui.plugin.add("draggable", "stack", {
914
- start: function() {
915
-
916
- var min,
917
- o = $(this).data("ui-draggable").options,
918
- group = $.makeArray($(o.stack)).sort(function(a,b) {
919
- return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);
920
- });
921
-
922
- if (!group.length) { return; }
923
-
924
- min = parseInt(group[0].style.zIndex, 10) || 0;
925
- $(group).each(function(i) {
926
- this.style.zIndex = min + i;
927
- });
928
-
929
- this[0].style.zIndex = min + group.length;
930
-
931
- }
932
- });
933
-
934
- $.ui.plugin.add("draggable", "zIndex", {
935
- start: function(event, ui) {
936
- var t = $(ui.helper), o = $(this).data("ui-draggable").options;
937
- if(t.css("zIndex")) {
938
- o._zIndex = t.css("zIndex");
939
- }
940
- t.css("zIndex", o.zIndex);
941
- },
942
- stop: function(event, ui) {
943
- var o = $(this).data("ui-draggable").options;
944
- if(o._zIndex) {
945
- $(ui.helper).css("zIndex", o._zIndex);
946
- }
947
- }
948
- });
949
-
950
- })(jQuery);