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,34 +1,36 @@
1
- //= require jquery.ui.core
2
- //= require jquery.ui.widget
3
- //= require jquery.ui.mouse
1
+ //= require jquery-ui/core
2
+ //= require jquery-ui/widget
3
+ //= require jquery-ui/mouse
4
4
 
5
5
  /*!
6
- * jQuery UI Resizable 1.10.0
6
+ * jQuery UI Resizable 1.11.3
7
7
  * http://jqueryui.com
8
8
  *
9
- * Copyright 2013 jQuery Foundation and other contributors
9
+ * Copyright jQuery Foundation and other contributors
10
10
  * Released under the MIT license.
11
11
  * http://jquery.org/license
12
12
  *
13
13
  * http://api.jqueryui.com/resizable/
14
- *
15
- * Depends:
16
- * jquery.ui.core.js
17
- * jquery.ui.mouse.js
18
- * jquery.ui.widget.js
19
14
  */
20
- (function( $, undefined ) {
21
-
22
- function num(v) {
23
- return parseInt(v, 10) || 0;
24
- }
25
-
26
- function isNumber(value) {
27
- return !isNaN(parseInt(value, 10));
28
- }
15
+ (function( factory ) {
16
+ if ( typeof define === "function" && define.amd ) {
17
+
18
+ // AMD. Register as an anonymous module.
19
+ define([
20
+ "jquery",
21
+ "./core",
22
+ "./mouse",
23
+ "./widget"
24
+ ], factory );
25
+ } else {
26
+
27
+ // Browser globals
28
+ factory( jQuery );
29
+ }
30
+ }(function( $ ) {
29
31
 
30
32
  $.widget("ui.resizable", $.ui.mouse, {
31
- version: "1.10.0",
33
+ version: "1.11.3",
32
34
  widgetEventPrefix: "resize",
33
35
  options: {
34
36
  alsoResize: false,
@@ -54,6 +56,37 @@ $.widget("ui.resizable", $.ui.mouse, {
54
56
  start: null,
55
57
  stop: null
56
58
  },
59
+
60
+ _num: function( value ) {
61
+ return parseInt( value, 10 ) || 0;
62
+ },
63
+
64
+ _isNumber: function( value ) {
65
+ return !isNaN( parseInt( value, 10 ) );
66
+ },
67
+
68
+ _hasScroll: function( el, a ) {
69
+
70
+ if ( $( el ).css( "overflow" ) === "hidden") {
71
+ return false;
72
+ }
73
+
74
+ var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
75
+ has = false;
76
+
77
+ if ( el[ scroll ] > 0 ) {
78
+ return true;
79
+ }
80
+
81
+ // TODO: determine which cases actually cause this to happen
82
+ // if the element doesn't have the scroll set, see if it's possible to
83
+ // set the scroll
84
+ el[ scroll ] = 1;
85
+ has = ( el[ scroll ] > 0 );
86
+ el[ scroll ] = 0;
87
+ return has;
88
+ },
89
+
57
90
  _create: function() {
58
91
 
59
92
  var n, i, handle, axis, hname,
@@ -69,10 +102,9 @@ $.widget("ui.resizable", $.ui.mouse, {
69
102
  _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
70
103
  });
71
104
 
72
- //Wrap the element if it cannot hold child nodes
73
- if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
105
+ // Wrap the element if it cannot hold child nodes
106
+ if (this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)) {
74
107
 
75
- //Create a wrapper element and set the wrapper to the new current internal element
76
108
  this.element.wrap(
77
109
  $("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
78
110
  position: this.element.css("position"),
@@ -83,34 +115,56 @@ $.widget("ui.resizable", $.ui.mouse, {
83
115
  })
84
116
  );
85
117
 
86
- //Overwrite the original this.element
87
118
  this.element = this.element.parent().data(
88
- "ui-resizable", this.element.data("ui-resizable")
119
+ "ui-resizable", this.element.resizable( "instance" )
89
120
  );
90
121
 
91
122
  this.elementIsWrapper = true;
92
123
 
93
- //Move margins to the wrapper
94
- this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
95
- this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
96
-
97
- //Prevent Safari textarea resize
124
+ this.element.css({
125
+ marginLeft: this.originalElement.css("marginLeft"),
126
+ marginTop: this.originalElement.css("marginTop"),
127
+ marginRight: this.originalElement.css("marginRight"),
128
+ marginBottom: this.originalElement.css("marginBottom")
129
+ });
130
+ this.originalElement.css({
131
+ marginLeft: 0,
132
+ marginTop: 0,
133
+ marginRight: 0,
134
+ marginBottom: 0
135
+ });
136
+ // support: Safari
137
+ // Prevent Safari textarea resize
98
138
  this.originalResizeStyle = this.originalElement.css("resize");
99
139
  this.originalElement.css("resize", "none");
100
140
 
101
- //Push the actual element to our proportionallyResize internal array
102
- this._proportionallyResizeElements.push(this.originalElement.css({ position: "static", zoom: 1, display: "block" }));
141
+ this._proportionallyResizeElements.push( this.originalElement.css({
142
+ position: "static",
143
+ zoom: 1,
144
+ display: "block"
145
+ }) );
103
146
 
147
+ // support: IE9
104
148
  // avoid IE jump (hard set the margin)
105
149
  this.originalElement.css({ margin: this.originalElement.css("margin") });
106
150
 
107
- // fix handlers offset
108
151
  this._proportionallyResize();
109
-
110
152
  }
111
153
 
112
- this.handles = o.handles || (!$(".ui-resizable-handle", this.element).length ? "e,s,se" : { n: ".ui-resizable-n", e: ".ui-resizable-e", s: ".ui-resizable-s", w: ".ui-resizable-w", se: ".ui-resizable-se", sw: ".ui-resizable-sw", ne: ".ui-resizable-ne", nw: ".ui-resizable-nw" });
113
- if(this.handles.constructor === String) {
154
+ this.handles = o.handles ||
155
+ ( !$(".ui-resizable-handle", this.element).length ?
156
+ "e,s,se" : {
157
+ n: ".ui-resizable-n",
158
+ e: ".ui-resizable-e",
159
+ s: ".ui-resizable-s",
160
+ w: ".ui-resizable-w",
161
+ se: ".ui-resizable-se",
162
+ sw: ".ui-resizable-sw",
163
+ ne: ".ui-resizable-ne",
164
+ nw: ".ui-resizable-nw"
165
+ } );
166
+
167
+ if (this.handles.constructor === String) {
114
168
 
115
169
  if ( this.handles === "all") {
116
170
  this.handles = "n,e,s,w,se,sw,ne,nw";
@@ -119,22 +173,20 @@ $.widget("ui.resizable", $.ui.mouse, {
119
173
  n = this.handles.split(",");
120
174
  this.handles = {};
121
175
 
122
- for(i = 0; i < n.length; i++) {
176
+ for (i = 0; i < n.length; i++) {
123
177
 
124
178
  handle = $.trim(n[i]);
125
- hname = "ui-resizable-"+handle;
179
+ hname = "ui-resizable-" + handle;
126
180
  axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
127
181
 
128
- // Apply zIndex to all handles - see #7960
129
182
  axis.css({ zIndex: o.zIndex });
130
183
 
131
- //TODO : What's going on here?
184
+ // TODO : What's going on here?
132
185
  if ("se" === handle) {
133
186
  axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
134
187
  }
135
188
 
136
- //Insert into internal handles object and append to element
137
- this.handles[handle] = ".ui-resizable-"+handle;
189
+ this.handles[handle] = ".ui-resizable-" + handle;
138
190
  this.element.append(axis);
139
191
  }
140
192
 
@@ -146,21 +198,18 @@ $.widget("ui.resizable", $.ui.mouse, {
146
198
 
147
199
  target = target || this.element;
148
200
 
149
- for(i in this.handles) {
201
+ for (i in this.handles) {
150
202
 
151
- if(this.handles[i].constructor === String) {
152
- this.handles[i] = $(this.handles[i], this.element).show();
203
+ if (this.handles[i].constructor === String) {
204
+ this.handles[i] = this.element.children( this.handles[ i ] ).first().show();
153
205
  }
154
206
 
155
- //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
156
- if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
207
+ if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {
157
208
 
158
209
  axis = $(this.handles[i], this.element);
159
210
 
160
- //Checking the correct pad and border
161
211
  padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
162
212
 
163
- //The padding type i have to apply...
164
213
  padPos = [ "padding",
165
214
  /ne|nw|n/.test(i) ? "Top" :
166
215
  /se|sw|s/.test(i) ? "Bottom" :
@@ -172,31 +221,28 @@ $.widget("ui.resizable", $.ui.mouse, {
172
221
 
173
222
  }
174
223
 
175
- //TODO: What's that good for? There's not anything to be executed left
176
- if(!$(this.handles[i]).length) {
224
+ // TODO: What's that good for? There's not anything to be executed left
225
+ if (!$(this.handles[i]).length) {
177
226
  continue;
178
227
  }
179
228
  }
180
229
  };
181
230
 
182
- //TODO: make renderAxis a prototype function
231
+ // TODO: make renderAxis a prototype function
183
232
  this._renderAxis(this.element);
184
233
 
185
234
  this._handles = $(".ui-resizable-handle", this.element)
186
235
  .disableSelection();
187
236
 
188
- //Matching axis name
189
237
  this._handles.mouseover(function() {
190
238
  if (!that.resizing) {
191
239
  if (this.className) {
192
240
  axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
193
241
  }
194
- //Axis, default = se
195
242
  that.axis = axis && axis[1] ? axis[1] : "se";
196
243
  }
197
244
  });
198
245
 
199
- //If we want to auto hide the elements
200
246
  if (o.autoHide) {
201
247
  this._handles.hide();
202
248
  $(this.element)
@@ -208,7 +254,7 @@ $.widget("ui.resizable", $.ui.mouse, {
208
254
  $(this).removeClass("ui-resizable-autohide");
209
255
  that._handles.show();
210
256
  })
211
- .mouseleave(function(){
257
+ .mouseleave(function() {
212
258
  if (o.disabled) {
213
259
  return;
214
260
  }
@@ -219,7 +265,6 @@ $.widget("ui.resizable", $.ui.mouse, {
219
265
  });
220
266
  }
221
267
 
222
- //Initialize the mouse interaction
223
268
  this._mouseInit();
224
269
 
225
270
  },
@@ -230,11 +275,16 @@ $.widget("ui.resizable", $.ui.mouse, {
230
275
 
231
276
  var wrapper,
232
277
  _destroy = function(exp) {
233
- $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
234
- .removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove();
278
+ $(exp)
279
+ .removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
280
+ .removeData("resizable")
281
+ .removeData("ui-resizable")
282
+ .unbind(".resizable")
283
+ .find(".ui-resizable-handle")
284
+ .remove();
235
285
  };
236
286
 
237
- //TODO: Unwrap at same DOM position
287
+ // TODO: Unwrap at same DOM position
238
288
  if (this.elementIsWrapper) {
239
289
  _destroy(this.element);
240
290
  wrapper = this.element;
@@ -272,39 +322,50 @@ $.widget("ui.resizable", $.ui.mouse, {
272
322
 
273
323
  var curleft, curtop, cursor,
274
324
  o = this.options,
275
- iniPos = this.element.position(),
276
325
  el = this.element;
277
326
 
278
327
  this.resizing = true;
279
328
 
280
- // bugfix for http://dev.jquery.com/ticket/1749
281
- if ( (/absolute/).test( el.css("position") ) ) {
282
- el.css({ position: "absolute", top: el.css("top"), left: el.css("left") });
283
- } else if (el.is(".ui-draggable")) {
284
- el.css({ position: "absolute", top: iniPos.top, left: iniPos.left });
285
- }
286
-
287
329
  this._renderProxy();
288
330
 
289
- curleft = num(this.helper.css("left"));
290
- curtop = num(this.helper.css("top"));
331
+ curleft = this._num(this.helper.css("left"));
332
+ curtop = this._num(this.helper.css("top"));
291
333
 
292
334
  if (o.containment) {
293
335
  curleft += $(o.containment).scrollLeft() || 0;
294
336
  curtop += $(o.containment).scrollTop() || 0;
295
337
  }
296
338
 
297
- //Store needed variables
298
339
  this.offset = this.helper.offset();
299
340
  this.position = { left: curleft, top: curtop };
300
- this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
301
- this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
341
+
342
+ this.size = this._helper ? {
343
+ width: this.helper.width(),
344
+ height: this.helper.height()
345
+ } : {
346
+ width: el.width(),
347
+ height: el.height()
348
+ };
349
+
350
+ this.originalSize = this._helper ? {
351
+ width: el.outerWidth(),
352
+ height: el.outerHeight()
353
+ } : {
354
+ width: el.width(),
355
+ height: el.height()
356
+ };
357
+
358
+ this.sizeDiff = {
359
+ width: el.outerWidth() - el.width(),
360
+ height: el.outerHeight() - el.height()
361
+ };
362
+
302
363
  this.originalPosition = { left: curleft, top: curtop };
303
- this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
304
364
  this.originalMousePosition = { left: event.pageX, top: event.pageY };
305
365
 
306
- //Aspect Ratio
307
- this.aspectRatio = (typeof o.aspectRatio === "number") ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
366
+ this.aspectRatio = (typeof o.aspectRatio === "number") ?
367
+ o.aspectRatio :
368
+ ((this.originalSize.width / this.originalSize.height) || 1);
308
369
 
309
370
  cursor = $(".ui-resizable-" + this.axis).css("cursor");
310
371
  $("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
@@ -316,27 +377,21 @@ $.widget("ui.resizable", $.ui.mouse, {
316
377
 
317
378
  _mouseDrag: function(event) {
318
379
 
319
- //Increase performance, avoid regex
320
- var data,
321
- el = this.helper, props = {},
380
+ var data, props,
322
381
  smp = this.originalMousePosition,
323
382
  a = this.axis,
324
- prevTop = this.position.top,
325
- prevLeft = this.position.left,
326
- prevWidth = this.size.width,
327
- prevHeight = this.size.height,
328
- dx = (event.pageX-smp.left)||0,
329
- dy = (event.pageY-smp.top)||0,
383
+ dx = (event.pageX - smp.left) || 0,
384
+ dy = (event.pageY - smp.top) || 0,
330
385
  trigger = this._change[a];
331
386
 
387
+ this._updatePrevProperties();
388
+
332
389
  if (!trigger) {
333
390
  return false;
334
391
  }
335
392
 
336
- // Calculate the attrs that will be change
337
- data = trigger.apply(this, [event, dx, dy]);
393
+ data = trigger.apply(this, [ event, dx, dy ]);
338
394
 
339
- // Put this in the mouseDrag handler since the user can start pressing shift while resizing
340
395
  this._updateVirtualBoundaries(event.shiftKey);
341
396
  if (this._aspectRatio || event.shiftKey) {
342
397
  data = this._updateRatio(data, event);
@@ -346,30 +401,18 @@ $.widget("ui.resizable", $.ui.mouse, {
346
401
 
347
402
  this._updateCache(data);
348
403
 
349
- // plugins callbacks need to be called first
350
404
  this._propagate("resize", event);
351
405
 
352
- if (this.position.top !== prevTop) {
353
- props.top = this.position.top + "px";
354
- }
355
- if (this.position.left !== prevLeft) {
356
- props.left = this.position.left + "px";
357
- }
358
- if (this.size.width !== prevWidth) {
359
- props.width = this.size.width + "px";
360
- }
361
- if (this.size.height !== prevHeight) {
362
- props.height = this.size.height + "px";
363
- }
364
- el.css(props);
406
+ props = this._applyChanges();
365
407
 
366
- if (!this._helper && this._proportionallyResizeElements.length) {
408
+ if ( !this._helper && this._proportionallyResizeElements.length ) {
367
409
  this._proportionallyResize();
368
410
  }
369
411
 
370
- // Call the user callback if the element was resized
371
- if ( ! $.isEmptyObject(props) ) {
372
- this._trigger("resize", event, this.ui());
412
+ if ( !$.isEmptyObject( props ) ) {
413
+ this._updatePrevProperties();
414
+ this._trigger( "resize", event, this.ui() );
415
+ this._applyChanges();
373
416
  }
374
417
 
375
418
  return false;
@@ -381,16 +424,21 @@ $.widget("ui.resizable", $.ui.mouse, {
381
424
  var pr, ista, soffseth, soffsetw, s, left, top,
382
425
  o = this.options, that = this;
383
426
 
384
- if(this._helper) {
427
+ if (this._helper) {
385
428
 
386
429
  pr = this._proportionallyResizeElements;
387
430
  ista = pr.length && (/textarea/i).test(pr[0].nodeName);
388
- soffseth = ista && $.ui.hasScroll(pr[0], "left") /* TODO - jump height */ ? 0 : that.sizeDiff.height;
431
+ soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
389
432
  soffsetw = ista ? 0 : that.sizeDiff.width;
390
433
 
391
- s = { width: (that.helper.width() - soffsetw), height: (that.helper.height() - soffseth) };
392
- left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null;
393
- top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null;
434
+ s = {
435
+ width: (that.helper.width() - soffsetw),
436
+ height: (that.helper.height() - soffseth)
437
+ };
438
+ left = (parseInt(that.element.css("left"), 10) +
439
+ (that.position.left - that.originalPosition.left)) || null;
440
+ top = (parseInt(that.element.css("top"), 10) +
441
+ (that.position.top - that.originalPosition.top)) || null;
394
442
 
395
443
  if (!o.animate) {
396
444
  this.element.css($.extend(s, { top: top, left: left }));
@@ -418,35 +466,65 @@ $.widget("ui.resizable", $.ui.mouse, {
418
466
 
419
467
  },
420
468
 
469
+ _updatePrevProperties: function() {
470
+ this.prevPosition = {
471
+ top: this.position.top,
472
+ left: this.position.left
473
+ };
474
+ this.prevSize = {
475
+ width: this.size.width,
476
+ height: this.size.height
477
+ };
478
+ },
479
+
480
+ _applyChanges: function() {
481
+ var props = {};
482
+
483
+ if ( this.position.top !== this.prevPosition.top ) {
484
+ props.top = this.position.top + "px";
485
+ }
486
+ if ( this.position.left !== this.prevPosition.left ) {
487
+ props.left = this.position.left + "px";
488
+ }
489
+ if ( this.size.width !== this.prevSize.width ) {
490
+ props.width = this.size.width + "px";
491
+ }
492
+ if ( this.size.height !== this.prevSize.height ) {
493
+ props.height = this.size.height + "px";
494
+ }
495
+
496
+ this.helper.css( props );
497
+
498
+ return props;
499
+ },
500
+
421
501
  _updateVirtualBoundaries: function(forceAspectRatio) {
422
502
  var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
423
503
  o = this.options;
424
504
 
425
505
  b = {
426
- minWidth: isNumber(o.minWidth) ? o.minWidth : 0,
427
- maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity,
428
- minHeight: isNumber(o.minHeight) ? o.minHeight : 0,
429
- maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity
506
+ minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
507
+ maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
508
+ minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
509
+ maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
430
510
  };
431
511
 
432
- if(this._aspectRatio || forceAspectRatio) {
433
- // We want to create an enclosing box whose aspect ration is the requested one
434
- // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension
512
+ if (this._aspectRatio || forceAspectRatio) {
435
513
  pMinWidth = b.minHeight * this.aspectRatio;
436
514
  pMinHeight = b.minWidth / this.aspectRatio;
437
515
  pMaxWidth = b.maxHeight * this.aspectRatio;
438
516
  pMaxHeight = b.maxWidth / this.aspectRatio;
439
517
 
440
- if(pMinWidth > b.minWidth) {
518
+ if (pMinWidth > b.minWidth) {
441
519
  b.minWidth = pMinWidth;
442
520
  }
443
- if(pMinHeight > b.minHeight) {
521
+ if (pMinHeight > b.minHeight) {
444
522
  b.minHeight = pMinHeight;
445
523
  }
446
- if(pMaxWidth < b.maxWidth) {
524
+ if (pMaxWidth < b.maxWidth) {
447
525
  b.maxWidth = pMaxWidth;
448
526
  }
449
- if(pMaxHeight < b.maxHeight) {
527
+ if (pMaxHeight < b.maxHeight) {
450
528
  b.maxHeight = pMaxHeight;
451
529
  }
452
530
  }
@@ -455,16 +533,16 @@ $.widget("ui.resizable", $.ui.mouse, {
455
533
 
456
534
  _updateCache: function(data) {
457
535
  this.offset = this.helper.offset();
458
- if (isNumber(data.left)) {
536
+ if (this._isNumber(data.left)) {
459
537
  this.position.left = data.left;
460
538
  }
461
- if (isNumber(data.top)) {
539
+ if (this._isNumber(data.top)) {
462
540
  this.position.top = data.top;
463
541
  }
464
- if (isNumber(data.height)) {
542
+ if (this._isNumber(data.height)) {
465
543
  this.size.height = data.height;
466
544
  }
467
- if (isNumber(data.width)) {
545
+ if (this._isNumber(data.width)) {
468
546
  this.size.width = data.width;
469
547
  }
470
548
  },
@@ -475,9 +553,9 @@ $.widget("ui.resizable", $.ui.mouse, {
475
553
  csize = this.size,
476
554
  a = this.axis;
477
555
 
478
- if (isNumber(data.height)) {
556
+ if (this._isNumber(data.height)) {
479
557
  data.width = (data.height * this.aspectRatio);
480
- } else if (isNumber(data.width)) {
558
+ } else if (this._isNumber(data.width)) {
481
559
  data.height = (data.width / this.aspectRatio);
482
560
  }
483
561
 
@@ -497,8 +575,10 @@ $.widget("ui.resizable", $.ui.mouse, {
497
575
 
498
576
  var o = this._vBoundaries,
499
577
  a = this.axis,
500
- ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
501
- isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
578
+ ismaxw = this._isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width),
579
+ ismaxh = this._isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
580
+ isminw = this._isNumber(data.width) && o.minWidth && (o.minWidth > data.width),
581
+ isminh = this._isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
502
582
  dw = this.originalPosition.left + this.originalSize.width,
503
583
  dh = this.position.top + this.size.height,
504
584
  cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
@@ -528,7 +608,7 @@ $.widget("ui.resizable", $.ui.mouse, {
528
608
  data.top = dh - o.maxHeight;
529
609
  }
530
610
 
531
- // fixing jump error on top/left - bug #2330
611
+ // Fixing jump error on top/left - bug #2330
532
612
  if (!data.width && !data.height && !data.left && data.top) {
533
613
  data.top = null;
534
614
  } else if (!data.width && !data.height && !data.top && data.left) {
@@ -538,32 +618,56 @@ $.widget("ui.resizable", $.ui.mouse, {
538
618
  return data;
539
619
  },
540
620
 
621
+ _getPaddingPlusBorderDimensions: function( element ) {
622
+ var i = 0,
623
+ widths = [],
624
+ borders = [
625
+ element.css( "borderTopWidth" ),
626
+ element.css( "borderRightWidth" ),
627
+ element.css( "borderBottomWidth" ),
628
+ element.css( "borderLeftWidth" )
629
+ ],
630
+ paddings = [
631
+ element.css( "paddingTop" ),
632
+ element.css( "paddingRight" ),
633
+ element.css( "paddingBottom" ),
634
+ element.css( "paddingLeft" )
635
+ ];
636
+
637
+ for ( ; i < 4; i++ ) {
638
+ widths[ i ] = ( parseInt( borders[ i ], 10 ) || 0 );
639
+ widths[ i ] += ( parseInt( paddings[ i ], 10 ) || 0 );
640
+ }
641
+
642
+ return {
643
+ height: widths[ 0 ] + widths[ 2 ],
644
+ width: widths[ 1 ] + widths[ 3 ]
645
+ };
646
+ },
647
+
541
648
  _proportionallyResize: function() {
542
649
 
543
650
  if (!this._proportionallyResizeElements.length) {
544
651
  return;
545
652
  }
546
653
 
547
- var i, j, borders, paddings, prel,
654
+ var prel,
655
+ i = 0,
548
656
  element = this.helper || this.element;
549
657
 
550
- for ( i=0; i < this._proportionallyResizeElements.length; i++) {
658
+ for ( ; i < this._proportionallyResizeElements.length; i++) {
551
659
 
552
660
  prel = this._proportionallyResizeElements[i];
553
661
 
554
- if (!this.borderDif) {
555
- this.borderDif = [];
556
- borders = [prel.css("borderTopWidth"), prel.css("borderRightWidth"), prel.css("borderBottomWidth"), prel.css("borderLeftWidth")];
557
- paddings = [prel.css("paddingTop"), prel.css("paddingRight"), prel.css("paddingBottom"), prel.css("paddingLeft")];
558
-
559
- for ( j = 0; j < borders.length; j++ ) {
560
- this.borderDif[ j ] = ( parseInt( borders[ j ], 10 ) || 0 ) + ( parseInt( paddings[ j ], 10 ) || 0 );
561
- }
662
+ // TODO: Seems like a bug to cache this.outerDimensions
663
+ // considering that we are in a loop.
664
+ if (!this.outerDimensions) {
665
+ this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
562
666
  }
563
667
 
564
668
  prel.css({
565
- height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
566
- width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
669
+ height: (element.height() - this.outerDimensions.height) || 0,
670
+ width: (element.width() - this.outerDimensions.width) || 0
567
671
  });
568
672
 
569
673
  }
@@ -575,7 +679,7 @@ $.widget("ui.resizable", $.ui.mouse, {
575
679
  var el = this.element, o = this.options;
576
680
  this.elementOffset = el.offset();
577
681
 
578
- if(this._helper) {
682
+ if (this._helper) {
579
683
 
580
684
  this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
581
685
 
@@ -583,8 +687,8 @@ $.widget("ui.resizable", $.ui.mouse, {
583
687
  width: this.element.outerWidth() - 1,
584
688
  height: this.element.outerHeight() - 1,
585
689
  position: "absolute",
586
- left: this.elementOffset.left +"px",
587
- top: this.elementOffset.top +"px",
690
+ left: this.elementOffset.left + "px",
691
+ top: this.elementOffset.top + "px",
588
692
  zIndex: ++o.zIndex //TODO: Don't modify option
589
693
  });
590
694
 
@@ -614,21 +718,25 @@ $.widget("ui.resizable", $.ui.mouse, {
614
718
  return { height: this.originalSize.height + dy };
615
719
  },
616
720
  se: function(event, dx, dy) {
617
- return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
721
+ return $.extend(this._change.s.apply(this, arguments),
722
+ this._change.e.apply(this, [ event, dx, dy ]));
618
723
  },
619
724
  sw: function(event, dx, dy) {
620
- return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
725
+ return $.extend(this._change.s.apply(this, arguments),
726
+ this._change.w.apply(this, [ event, dx, dy ]));
621
727
  },
622
728
  ne: function(event, dx, dy) {
623
- return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
729
+ return $.extend(this._change.n.apply(this, arguments),
730
+ this._change.e.apply(this, [ event, dx, dy ]));
624
731
  },
625
732
  nw: function(event, dx, dy) {
626
- return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
733
+ return $.extend(this._change.n.apply(this, arguments),
734
+ this._change.w.apply(this, [ event, dx, dy ]));
627
735
  }
628
736
  },
629
737
 
630
738
  _propagate: function(n, event) {
631
- $.ui.plugin.call(this, n, [event, this.ui()]);
739
+ $.ui.plugin.call(this, n, [ event, this.ui() ]);
632
740
  (n !== "resize" && this._trigger(n, event, this.ui()));
633
741
  },
634
742
 
@@ -655,15 +763,17 @@ $.widget("ui.resizable", $.ui.mouse, {
655
763
  $.ui.plugin.add("resizable", "animate", {
656
764
 
657
765
  stop: function( event ) {
658
- var that = $(this).data("ui-resizable"),
766
+ var that = $(this).resizable( "instance" ),
659
767
  o = that.options,
660
768
  pr = that._proportionallyResizeElements,
661
769
  ista = pr.length && (/textarea/i).test(pr[0].nodeName),
662
- soffseth = ista && $.ui.hasScroll(pr[0], "left") /* TODO - jump height */ ? 0 : that.sizeDiff.height,
770
+ soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height,
663
771
  soffsetw = ista ? 0 : that.sizeDiff.width,
664
772
  style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },
665
- left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null,
666
- top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null;
773
+ left = (parseInt(that.element.css("left"), 10) +
774
+ (that.position.left - that.originalPosition.left)) || null,
775
+ top = (parseInt(that.element.css("top"), 10) +
776
+ (that.position.top - that.originalPosition.top)) || null;
667
777
 
668
778
  that.element.animate(
669
779
  $.extend(style, top && left ? { top: top, left: left } : {}), {
@@ -693,138 +803,193 @@ $.ui.plugin.add("resizable", "animate", {
693
803
 
694
804
  });
695
805
 
696
- $.ui.plugin.add("resizable", "containment", {
806
+ $.ui.plugin.add( "resizable", "containment", {
697
807
 
698
808
  start: function() {
699
809
  var element, p, co, ch, cw, width, height,
700
- that = $(this).data("ui-resizable"),
810
+ that = $( this ).resizable( "instance" ),
701
811
  o = that.options,
702
812
  el = that.element,
703
813
  oc = o.containment,
704
- ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
814
+ ce = ( oc instanceof $ ) ? oc.get( 0 ) : ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
705
815
 
706
- if (!ce) {
816
+ if ( !ce ) {
707
817
  return;
708
818
  }
709
819
 
710
- that.containerElement = $(ce);
820
+ that.containerElement = $( ce );
711
821
 
712
- if (/document/.test(oc) || oc === document) {
713
- that.containerOffset = { left: 0, top: 0 };
714
- that.containerPosition = { left: 0, top: 0 };
822
+ if ( /document/.test( oc ) || oc === document ) {
823
+ that.containerOffset = {
824
+ left: 0,
825
+ top: 0
826
+ };
827
+ that.containerPosition = {
828
+ left: 0,
829
+ top: 0
830
+ };
715
831
 
716
832
  that.parentData = {
717
- element: $(document), left: 0, top: 0,
718
- width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
833
+ element: $( document ),
834
+ left: 0,
835
+ top: 0,
836
+ width: $( document ).width(),
837
+ height: $( document ).height() || document.body.parentNode.scrollHeight
719
838
  };
720
- }
721
-
722
- // i'm a node, so compute top, left, right, bottom
723
- else {
724
- element = $(ce);
839
+ } else {
840
+ element = $( ce );
725
841
  p = [];
726
- $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
842
+ $([ "Top", "Right", "Left", "Bottom" ]).each(function( i, name ) {
843
+ p[ i ] = that._num( element.css( "padding" + name ) );
844
+ });
727
845
 
728
846
  that.containerOffset = element.offset();
729
847
  that.containerPosition = element.position();
730
- that.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
848
+ that.containerSize = {
849
+ height: ( element.innerHeight() - p[ 3 ] ),
850
+ width: ( element.innerWidth() - p[ 1 ] )
851
+ };
731
852
 
732
853
  co = that.containerOffset;
733
854
  ch = that.containerSize.height;
734
855
  cw = that.containerSize.width;
735
- width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw );
736
- height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
856
+ width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
857
+ height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
737
858
 
738
859
  that.parentData = {
739
- element: ce, left: co.left, top: co.top, width: width, height: height
860
+ element: ce,
861
+ left: co.left,
862
+ top: co.top,
863
+ width: width,
864
+ height: height
740
865
  };
741
866
  }
742
867
  },
743
868
 
744
869
  resize: function( event ) {
745
870
  var woset, hoset, isParent, isOffsetRelative,
746
- that = $(this).data("ui-resizable"),
871
+ that = $( this ).resizable( "instance" ),
747
872
  o = that.options,
748
- co = that.containerOffset, cp = that.position,
873
+ co = that.containerOffset,
874
+ cp = that.position,
749
875
  pRatio = that._aspectRatio || event.shiftKey,
750
- cop = { top:0, left:0 }, ce = that.containerElement;
876
+ cop = {
877
+ top: 0,
878
+ left: 0
879
+ },
880
+ ce = that.containerElement,
881
+ continueResize = true;
751
882
 
752
- if (ce[0] !== document && (/static/).test(ce.css("position"))) {
883
+ if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
753
884
  cop = co;
754
885
  }
755
886
 
756
- if (cp.left < (that._helper ? co.left : 0)) {
757
- that.size.width = that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left));
758
- if (pRatio) {
887
+ if ( cp.left < ( that._helper ? co.left : 0 ) ) {
888
+ that.size.width = that.size.width +
889
+ ( that._helper ?
890
+ ( that.position.left - co.left ) :
891
+ ( that.position.left - cop.left ) );
892
+
893
+ if ( pRatio ) {
759
894
  that.size.height = that.size.width / that.aspectRatio;
895
+ continueResize = false;
760
896
  }
761
897
  that.position.left = o.helper ? co.left : 0;
762
898
  }
763
899
 
764
- if (cp.top < (that._helper ? co.top : 0)) {
765
- that.size.height = that.size.height + (that._helper ? (that.position.top - co.top) : that.position.top);
766
- if (pRatio) {
900
+ if ( cp.top < ( that._helper ? co.top : 0 ) ) {
901
+ that.size.height = that.size.height +
902
+ ( that._helper ?
903
+ ( that.position.top - co.top ) :
904
+ that.position.top );
905
+
906
+ if ( pRatio ) {
767
907
  that.size.width = that.size.height * that.aspectRatio;
908
+ continueResize = false;
768
909
  }
769
910
  that.position.top = that._helper ? co.top : 0;
770
911
  }
771
912
 
772
- that.offset.left = that.parentData.left+that.position.left;
773
- that.offset.top = that.parentData.top+that.position.top;
913
+ isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
914
+ isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
774
915
 
775
- woset = Math.abs( (that._helper ? that.offset.left - cop.left : (that.offset.left - cop.left)) + that.sizeDiff.width );
776
- hoset = Math.abs( (that._helper ? that.offset.top - cop.top : (that.offset.top - co.top)) + that.sizeDiff.height );
916
+ if ( isParent && isOffsetRelative ) {
917
+ that.offset.left = that.parentData.left + that.position.left;
918
+ that.offset.top = that.parentData.top + that.position.top;
919
+ } else {
920
+ that.offset.left = that.element.offset().left;
921
+ that.offset.top = that.element.offset().top;
922
+ }
777
923
 
778
- isParent = that.containerElement.get(0) === that.element.parent().get(0);
779
- isOffsetRelative = /relative|absolute/.test(that.containerElement.css("position"));
924
+ woset = Math.abs( that.sizeDiff.width +
925
+ (that._helper ?
926
+ that.offset.left - cop.left :
927
+ (that.offset.left - co.left)) );
780
928
 
781
- if(isParent && isOffsetRelative) {
782
- woset -= that.parentData.left;
783
- }
929
+ hoset = Math.abs( that.sizeDiff.height +
930
+ (that._helper ?
931
+ that.offset.top - cop.top :
932
+ (that.offset.top - co.top)) );
784
933
 
785
- if (woset + that.size.width >= that.parentData.width) {
934
+ if ( woset + that.size.width >= that.parentData.width ) {
786
935
  that.size.width = that.parentData.width - woset;
787
- if (pRatio) {
936
+ if ( pRatio ) {
788
937
  that.size.height = that.size.width / that.aspectRatio;
938
+ continueResize = false;
789
939
  }
790
940
  }
791
941
 
792
- if (hoset + that.size.height >= that.parentData.height) {
942
+ if ( hoset + that.size.height >= that.parentData.height ) {
793
943
  that.size.height = that.parentData.height - hoset;
794
- if (pRatio) {
944
+ if ( pRatio ) {
795
945
  that.size.width = that.size.height * that.aspectRatio;
946
+ continueResize = false;
796
947
  }
797
948
  }
949
+
950
+ if ( !continueResize ) {
951
+ that.position.left = that.prevPosition.left;
952
+ that.position.top = that.prevPosition.top;
953
+ that.size.width = that.prevSize.width;
954
+ that.size.height = that.prevSize.height;
955
+ }
798
956
  },
799
957
 
800
- stop: function(){
801
- var that = $(this).data("ui-resizable"),
958
+ stop: function() {
959
+ var that = $( this ).resizable( "instance" ),
802
960
  o = that.options,
803
961
  co = that.containerOffset,
804
962
  cop = that.containerPosition,
805
963
  ce = that.containerElement,
806
- helper = $(that.helper),
964
+ helper = $( that.helper ),
807
965
  ho = helper.offset(),
808
966
  w = helper.outerWidth() - that.sizeDiff.width,
809
967
  h = helper.outerHeight() - that.sizeDiff.height;
810
968
 
811
- if (that._helper && !o.animate && (/relative/).test(ce.css("position"))) {
812
- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
969
+ if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
970
+ $( this ).css({
971
+ left: ho.left - cop.left - co.left,
972
+ width: w,
973
+ height: h
974
+ });
813
975
  }
814
976
 
815
- if (that._helper && !o.animate && (/static/).test(ce.css("position"))) {
816
- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
977
+ if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
978
+ $( this ).css({
979
+ left: ho.left - cop.left - co.left,
980
+ width: w,
981
+ height: h
982
+ });
817
983
  }
818
-
819
984
  }
820
985
  });
821
986
 
822
987
  $.ui.plugin.add("resizable", "alsoResize", {
823
988
 
824
- start: function () {
825
- var that = $(this).data("ui-resizable"),
989
+ start: function() {
990
+ var that = $(this).resizable( "instance" ),
826
991
  o = that.options,
827
- _store = function (exp) {
992
+ _store = function(exp) {
828
993
  $(exp).each(function() {
829
994
  var el = $(this);
830
995
  el.data("ui-resizable-alsoresize", {
@@ -835,30 +1000,42 @@ $.ui.plugin.add("resizable", "alsoResize", {
835
1000
  };
836
1001
 
837
1002
  if (typeof(o.alsoResize) === "object" && !o.alsoResize.parentNode) {
838
- if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
839
- else { $.each(o.alsoResize, function (exp) { _store(exp); }); }
840
- }else{
1003
+ if (o.alsoResize.length) {
1004
+ o.alsoResize = o.alsoResize[0];
1005
+ _store(o.alsoResize);
1006
+ } else {
1007
+ $.each(o.alsoResize, function(exp) {
1008
+ _store(exp);
1009
+ });
1010
+ }
1011
+ } else {
841
1012
  _store(o.alsoResize);
842
1013
  }
843
1014
  },
844
1015
 
845
- resize: function (event, ui) {
846
- var that = $(this).data("ui-resizable"),
1016
+ resize: function(event, ui) {
1017
+ var that = $(this).resizable( "instance" ),
847
1018
  o = that.options,
848
1019
  os = that.originalSize,
849
1020
  op = that.originalPosition,
850
1021
  delta = {
851
- height: (that.size.height - os.height) || 0, width: (that.size.width - os.width) || 0,
852
- top: (that.position.top - op.top) || 0, left: (that.position.left - op.left) || 0
1022
+ height: (that.size.height - os.height) || 0,
1023
+ width: (that.size.width - os.width) || 0,
1024
+ top: (that.position.top - op.top) || 0,
1025
+ left: (that.position.left - op.left) || 0
853
1026
  },
854
1027
 
855
- _alsoResize = function (exp, c) {
1028
+ _alsoResize = function(exp, c) {
856
1029
  $(exp).each(function() {
857
1030
  var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
858
- css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"];
859
-
860
- $.each(css, function (i, prop) {
861
- var sum = (start[prop]||0) + (delta[prop]||0);
1031
+ css = c && c.length ?
1032
+ c :
1033
+ el.parents(ui.originalElement[0]).length ?
1034
+ [ "width", "height" ] :
1035
+ [ "width", "height", "top", "left" ];
1036
+
1037
+ $.each(css, function(i, prop) {
1038
+ var sum = (start[prop] || 0) + (delta[prop] || 0);
862
1039
  if (sum && sum >= 0) {
863
1040
  style[prop] = sum || null;
864
1041
  }
@@ -869,13 +1046,15 @@ $.ui.plugin.add("resizable", "alsoResize", {
869
1046
  };
870
1047
 
871
1048
  if (typeof(o.alsoResize) === "object" && !o.alsoResize.nodeType) {
872
- $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });
873
- }else{
1049
+ $.each(o.alsoResize, function(exp, c) {
1050
+ _alsoResize(exp, c);
1051
+ });
1052
+ } else {
874
1053
  _alsoResize(o.alsoResize);
875
1054
  }
876
1055
  },
877
1056
 
878
- stop: function () {
1057
+ stop: function() {
879
1058
  $(this).removeData("resizable-alsoresize");
880
1059
  }
881
1060
  });
@@ -884,11 +1063,20 @@ $.ui.plugin.add("resizable", "ghost", {
884
1063
 
885
1064
  start: function() {
886
1065
 
887
- var that = $(this).data("ui-resizable"), o = that.options, cs = that.size;
1066
+ var that = $(this).resizable( "instance" ), o = that.options, cs = that.size;
888
1067
 
889
1068
  that.ghost = that.originalElement.clone();
890
1069
  that.ghost
891
- .css({ opacity: 0.25, display: "block", position: "relative", height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
1070
+ .css({
1071
+ opacity: 0.25,
1072
+ display: "block",
1073
+ position: "relative",
1074
+ height: cs.height,
1075
+ width: cs.width,
1076
+ margin: 0,
1077
+ left: 0,
1078
+ top: 0
1079
+ })
892
1080
  .addClass("ui-resizable-ghost")
893
1081
  .addClass(typeof o.ghost === "string" ? o.ghost : "");
894
1082
 
@@ -896,15 +1084,19 @@ $.ui.plugin.add("resizable", "ghost", {
896
1084
 
897
1085
  },
898
1086
 
899
- resize: function(){
900
- var that = $(this).data("ui-resizable");
1087
+ resize: function() {
1088
+ var that = $(this).resizable( "instance" );
901
1089
  if (that.ghost) {
902
- that.ghost.css({ position: "relative", height: that.size.height, width: that.size.width });
1090
+ that.ghost.css({
1091
+ position: "relative",
1092
+ height: that.size.height,
1093
+ width: that.size.width
1094
+ });
903
1095
  }
904
1096
  },
905
1097
 
906
1098
  stop: function() {
907
- var that = $(this).data("ui-resizable");
1099
+ var that = $(this).resizable( "instance" );
908
1100
  if (that.ghost && that.helper) {
909
1101
  that.helper.get(0).removeChild(that.ghost.get(0));
910
1102
  }
@@ -915,15 +1107,16 @@ $.ui.plugin.add("resizable", "ghost", {
915
1107
  $.ui.plugin.add("resizable", "grid", {
916
1108
 
917
1109
  resize: function() {
918
- var that = $(this).data("ui-resizable"),
1110
+ var outerDimensions,
1111
+ that = $(this).resizable( "instance" ),
919
1112
  o = that.options,
920
1113
  cs = that.size,
921
1114
  os = that.originalSize,
922
1115
  op = that.originalPosition,
923
1116
  a = that.axis,
924
- grid = typeof o.grid === "number" ? [o.grid, o.grid] : o.grid,
925
- gridX = (grid[0]||1),
926
- gridY = (grid[1]||1),
1117
+ grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
1118
+ gridX = (grid[0] || 1),
1119
+ gridY = (grid[1] || 1),
927
1120
  ox = Math.round((cs.width - os.width) / gridX) * gridX,
928
1121
  oy = Math.round((cs.height - os.height) / gridY) * gridY,
929
1122
  newWidth = os.width + ox,
@@ -936,16 +1129,16 @@ $.ui.plugin.add("resizable", "grid", {
936
1129
  o.grid = grid;
937
1130
 
938
1131
  if (isMinWidth) {
939
- newWidth = newWidth + gridX;
1132
+ newWidth += gridX;
940
1133
  }
941
1134
  if (isMinHeight) {
942
- newHeight = newHeight + gridY;
1135
+ newHeight += gridY;
943
1136
  }
944
1137
  if (isMaxWidth) {
945
- newWidth = newWidth - gridX;
1138
+ newWidth -= gridX;
946
1139
  }
947
1140
  if (isMaxHeight) {
948
- newHeight = newHeight - gridY;
1141
+ newHeight -= gridY;
949
1142
  }
950
1143
 
951
1144
  if (/^(se|s|e)$/.test(a)) {
@@ -960,13 +1153,31 @@ $.ui.plugin.add("resizable", "grid", {
960
1153
  that.size.height = newHeight;
961
1154
  that.position.left = op.left - ox;
962
1155
  } else {
963
- that.size.width = newWidth;
964
- that.size.height = newHeight;
965
- that.position.top = op.top - oy;
966
- that.position.left = op.left - ox;
1156
+ if ( newHeight - gridY <= 0 || newWidth - gridX <= 0) {
1157
+ outerDimensions = that._getPaddingPlusBorderDimensions( this );
1158
+ }
1159
+
1160
+ if ( newHeight - gridY > 0 ) {
1161
+ that.size.height = newHeight;
1162
+ that.position.top = op.top - oy;
1163
+ } else {
1164
+ newHeight = gridY - outerDimensions.height;
1165
+ that.size.height = newHeight;
1166
+ that.position.top = op.top + os.height - newHeight;
1167
+ }
1168
+ if ( newWidth - gridX > 0 ) {
1169
+ that.size.width = newWidth;
1170
+ that.position.left = op.left - ox;
1171
+ } else {
1172
+ newWidth = gridX - outerDimensions.width;
1173
+ that.size.width = newWidth;
1174
+ that.position.left = op.left + os.width - newWidth;
1175
+ }
967
1176
  }
968
1177
  }
969
1178
 
970
1179
  });
971
1180
 
972
- })(jQuery);
1181
+ return $.ui.resizable;
1182
+
1183
+ }));