jquery-ui-rails 5.0.5 → 6.0.0
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.
- checksums.yaml +7 -0
- data/.travis.yml +1 -1
- data/History.md +12 -0
- data/README.md +47 -30
- data/Rakefile +48 -27
- data/VERSIONS.md +1 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_444444_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_555555_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_777620_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_777777_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_cc0000_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
- data/app/assets/javascripts/jquery-ui.js +52 -33
- data/app/assets/javascripts/jquery-ui/core.js +37 -304
- data/app/assets/javascripts/jquery-ui/data.js +41 -0
- data/app/assets/javascripts/jquery-ui/disable-selection.js +48 -0
- data/app/assets/javascripts/jquery-ui/effect.all.js +15 -16
- data/app/assets/javascripts/jquery-ui/effect.js +620 -284
- data/app/assets/javascripts/jquery-ui/effects/effect-blind.js +73 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-bounce.js +113 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-clip.js +68 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-drop.js +72 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-explode.js +114 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-fade.js +50 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-fold.js +92 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-highlight.js +60 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-puff.js +46 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-pulsate.js +67 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-scale.js +60 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-shake.js +77 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-size.js +194 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-slide.js +79 -0
- data/app/assets/javascripts/jquery-ui/effects/effect-transfer.js +43 -0
- data/app/assets/javascripts/jquery-ui/escape-selector.js +23 -0
- data/app/assets/javascripts/jquery-ui/focusable.js +86 -0
- data/app/assets/javascripts/jquery-ui/form-reset-mixin.js +80 -0
- data/app/assets/javascripts/jquery-ui/form.js +22 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-af.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ar-DZ.js +39 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ar.js +39 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-az.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-be.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-bg.js +38 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-bs.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ca.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-cs.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-cy-GB.js +45 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-da.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-de.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-el.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-AU.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-GB.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-NZ.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-eo.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-es.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-et.js +45 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-eu.js +36 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-fa.js +73 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-fi.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-fo.js +45 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr-CA.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr-CH.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr.js +39 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-gl.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-he.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-hi.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-hr.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-hu.js +36 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-hy.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-id.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-is.js +45 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-it-CH.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-it.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ja.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ka.js +48 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-kk.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-km.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ko.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ky.js +38 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-lb.js +45 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-lt.js +45 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-lv.js +45 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-mk.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ml.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ms.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-nb.js +49 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-nl-BE.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-nl.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-nn.js +49 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-no.js +50 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-pl.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-pt-BR.js +45 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-pt.js +44 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-rm.js +61 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ro.js +40 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ru.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-sk.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-sl.js +38 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-sq.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-sr-SR.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-sr.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-sv.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-ta.js +53 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-th.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-tj.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-tr.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-uk.js +38 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-vi.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-CN.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-HK.js +37 -0
- data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-TW.js +37 -0
- data/app/assets/javascripts/jquery-ui/ie.js +17 -0
- data/app/assets/javascripts/jquery-ui/jquery-1-7.js +91 -0
- data/app/assets/javascripts/jquery-ui/keycode.js +47 -0
- data/app/assets/javascripts/jquery-ui/labels.js +65 -0
- data/app/assets/javascripts/jquery-ui/plugin.js +46 -0
- data/app/assets/javascripts/jquery-ui/position.js +92 -109
- data/app/assets/javascripts/jquery-ui/safe-active-element.js +42 -0
- data/app/assets/javascripts/jquery-ui/safe-blur.js +23 -0
- data/app/assets/javascripts/jquery-ui/scroll-parent.js +47 -0
- data/app/assets/javascripts/jquery-ui/tabbable.js +38 -0
- data/app/assets/javascripts/jquery-ui/unique-id.js +51 -0
- data/app/assets/javascripts/jquery-ui/version.js +17 -0
- data/app/assets/javascripts/jquery-ui/widget.js +328 -151
- data/app/assets/javascripts/jquery-ui/{accordion.js → widgets/accordion.js} +187 -162
- data/app/assets/javascripts/jquery-ui/{autocomplete.js → widgets/autocomplete.js} +148 -92
- data/app/assets/javascripts/jquery-ui/widgets/button.js +391 -0
- data/app/assets/javascripts/jquery-ui/widgets/checkboxradio.js +291 -0
- data/app/assets/javascripts/jquery-ui/widgets/controlgroup.js +300 -0
- data/app/assets/javascripts/jquery-ui/widgets/datepicker.js +2123 -0
- data/app/assets/javascripts/jquery-ui/{dialog.js → widgets/dialog.js} +229 -158
- data/app/assets/javascripts/jquery-ui/{draggable.js → widgets/draggable.js} +416 -293
- data/app/assets/javascripts/jquery-ui/{droppable.js → widgets/droppable.js} +167 -83
- data/app/assets/javascripts/jquery-ui/{menu.js → widgets/menu.js} +164 -134
- data/app/assets/javascripts/jquery-ui/widgets/mouse.js +230 -0
- data/app/assets/javascripts/jquery-ui/{progressbar.js → widgets/progressbar.js} +60 -41
- data/app/assets/javascripts/jquery-ui/{resizable.js → widgets/resizable.js} +413 -362
- data/app/assets/javascripts/jquery-ui/widgets/selectable.js +314 -0
- data/app/assets/javascripts/jquery-ui/{selectmenu.js → widgets/selectmenu.js} +253 -176
- data/app/assets/javascripts/jquery-ui/{slider.js → widgets/slider.js} +193 -157
- data/app/assets/javascripts/jquery-ui/widgets/sortable.js +1561 -0
- data/app/assets/javascripts/jquery-ui/{spinner.js → widgets/spinner.js} +175 -112
- data/app/assets/javascripts/jquery-ui/{tabs.js → widgets/tabs.js} +237 -195
- data/app/assets/javascripts/jquery-ui/{tooltip.js → widgets/tooltip.js} +136 -87
- data/app/assets/stylesheets/jquery-ui/accordion.css +1 -15
- data/app/assets/stylesheets/jquery-ui/all.css +1 -1
- data/app/assets/stylesheets/jquery-ui/autocomplete.css +1 -3
- data/app/assets/stylesheets/jquery-ui/base.css +3 -1
- data/app/assets/stylesheets/jquery-ui/button.css +35 -68
- data/app/assets/stylesheets/jquery-ui/checkboxradio.css +37 -0
- data/app/assets/stylesheets/jquery-ui/controlgroup.css +68 -0
- data/app/assets/stylesheets/jquery-ui/core.css +11 -7
- data/app/assets/stylesheets/jquery-ui/datepicker.css +11 -2
- data/app/assets/stylesheets/jquery-ui/dialog.css +38 -11
- data/app/assets/stylesheets/jquery-ui/draggable.css +1 -2
- data/app/assets/stylesheets/jquery-ui/menu.css +7 -7
- data/app/assets/stylesheets/jquery-ui/progressbar.css +1 -2
- data/app/assets/stylesheets/jquery-ui/resizable.css +1 -2
- data/app/assets/stylesheets/jquery-ui/selectable.css +1 -2
- data/app/assets/stylesheets/jquery-ui/selectmenu.css +11 -22
- data/app/assets/stylesheets/jquery-ui/slider.css +1 -2
- data/app/assets/stylesheets/jquery-ui/sortable.css +1 -2
- data/app/assets/stylesheets/jquery-ui/spinner.css +7 -22
- data/app/assets/stylesheets/jquery-ui/tabs.css +1 -2
- data/app/assets/stylesheets/jquery-ui/theme.css.erb +113 -87
- data/app/assets/stylesheets/jquery-ui/tooltip.css +1 -4
- data/lib/jquery/ui/rails/version.rb +2 -2
- metadata +150 -144
- data/app/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_888888_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/javascripts/jquery-ui/button.js +0 -414
- data/app/assets/javascripts/jquery-ui/datepicker-af.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ar-DZ.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ar.js +0 -38
- data/app/assets/javascripts/jquery-ui/datepicker-az.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-be.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-bg.js +0 -38
- data/app/assets/javascripts/jquery-ui/datepicker-bs.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ca.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-cs.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-cy-GB.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-da.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-de.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-el.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-en-AU.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-en-GB.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-en-NZ.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-eo.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-es.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-et.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-eu.js +0 -36
- data/app/assets/javascripts/jquery-ui/datepicker-fa.js +0 -73
- data/app/assets/javascripts/jquery-ui/datepicker-fi.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-fo.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-fr-CA.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-fr-CH.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-fr.js +0 -39
- data/app/assets/javascripts/jquery-ui/datepicker-gl.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-he.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-hi.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-hr.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-hu.js +0 -36
- data/app/assets/javascripts/jquery-ui/datepicker-hy.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-id.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-is.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-it-CH.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-it.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ja.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ka.js +0 -35
- data/app/assets/javascripts/jquery-ui/datepicker-kk.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-km.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ko.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ky.js +0 -38
- data/app/assets/javascripts/jquery-ui/datepicker-lb.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-lt.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-lv.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-mk.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ml.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ms.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-nb.js +0 -36
- data/app/assets/javascripts/jquery-ui/datepicker-nl-BE.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-nl.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-nn.js +0 -36
- data/app/assets/javascripts/jquery-ui/datepicker-no.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-pl.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-pt-BR.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-pt.js +0 -36
- data/app/assets/javascripts/jquery-ui/datepicker-rm.js +0 -35
- data/app/assets/javascripts/jquery-ui/datepicker-ro.js +0 -40
- data/app/assets/javascripts/jquery-ui/datepicker-ru.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-sk.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-sl.js +0 -38
- data/app/assets/javascripts/jquery-ui/datepicker-sq.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-sr-SR.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-sr.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-sv.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-ta.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-th.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-tj.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-tr.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-uk.js +0 -38
- data/app/assets/javascripts/jquery-ui/datepicker-vi.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-zh-CN.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-zh-HK.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker-zh-TW.js +0 -37
- data/app/assets/javascripts/jquery-ui/datepicker.js +0 -2086
- data/app/assets/javascripts/jquery-ui/effect-blind.js +0 -92
- data/app/assets/javascripts/jquery-ui/effect-bounce.js +0 -125
- data/app/assets/javascripts/jquery-ui/effect-clip.js +0 -79
- data/app/assets/javascripts/jquery-ui/effect-drop.js +0 -77
- data/app/assets/javascripts/jquery-ui/effect-explode.js +0 -109
- data/app/assets/javascripts/jquery-ui/effect-fade.js +0 -42
- data/app/assets/javascripts/jquery-ui/effect-fold.js +0 -88
- data/app/assets/javascripts/jquery-ui/effect-highlight.js +0 -62
- data/app/assets/javascripts/jquery-ui/effect-puff.js +0 -63
- data/app/assets/javascripts/jquery-ui/effect-pulsate.js +0 -75
- data/app/assets/javascripts/jquery-ui/effect-scale.js +0 -92
- data/app/assets/javascripts/jquery-ui/effect-shake.js +0 -86
- data/app/assets/javascripts/jquery-ui/effect-size.js +0 -235
- data/app/assets/javascripts/jquery-ui/effect-slide.js +0 -76
- data/app/assets/javascripts/jquery-ui/effect-transfer.js +0 -59
- data/app/assets/javascripts/jquery-ui/mouse.js +0 -202
- data/app/assets/javascripts/jquery-ui/selectable.js +0 -291
- data/app/assets/javascripts/jquery-ui/sortable.js +0 -1319
@@ -0,0 +1,230 @@
|
|
1
|
+
//= require jquery-ui/ie
|
2
|
+
//= require jquery-ui/version
|
3
|
+
//= require jquery-ui/widget
|
4
|
+
|
5
|
+
/*!
|
6
|
+
* jQuery UI Mouse 1.12.1
|
7
|
+
* http://jqueryui.com
|
8
|
+
*
|
9
|
+
* Copyright jQuery Foundation and other contributors
|
10
|
+
* Released under the MIT license.
|
11
|
+
* http://jquery.org/license
|
12
|
+
*/
|
13
|
+
|
14
|
+
//>>label: Mouse
|
15
|
+
//>>group: Widgets
|
16
|
+
//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
|
17
|
+
//>>docs: http://api.jqueryui.com/mouse/
|
18
|
+
|
19
|
+
( function( factory ) {
|
20
|
+
if ( typeof define === "function" && define.amd ) {
|
21
|
+
|
22
|
+
// AMD. Register as an anonymous module.
|
23
|
+
define( [
|
24
|
+
"jquery",
|
25
|
+
"../ie",
|
26
|
+
"../version",
|
27
|
+
"../widget"
|
28
|
+
], factory );
|
29
|
+
} else {
|
30
|
+
|
31
|
+
// Browser globals
|
32
|
+
factory( jQuery );
|
33
|
+
}
|
34
|
+
}( function( $ ) {
|
35
|
+
|
36
|
+
var mouseHandled = false;
|
37
|
+
$( document ).on( "mouseup", function() {
|
38
|
+
mouseHandled = false;
|
39
|
+
} );
|
40
|
+
|
41
|
+
return $.widget( "ui.mouse", {
|
42
|
+
version: "1.12.1",
|
43
|
+
options: {
|
44
|
+
cancel: "input, textarea, button, select, option",
|
45
|
+
distance: 1,
|
46
|
+
delay: 0
|
47
|
+
},
|
48
|
+
_mouseInit: function() {
|
49
|
+
var that = this;
|
50
|
+
|
51
|
+
this.element
|
52
|
+
.on( "mousedown." + this.widgetName, function( event ) {
|
53
|
+
return that._mouseDown( event );
|
54
|
+
} )
|
55
|
+
.on( "click." + this.widgetName, function( event ) {
|
56
|
+
if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) {
|
57
|
+
$.removeData( event.target, that.widgetName + ".preventClickEvent" );
|
58
|
+
event.stopImmediatePropagation();
|
59
|
+
return false;
|
60
|
+
}
|
61
|
+
} );
|
62
|
+
|
63
|
+
this.started = false;
|
64
|
+
},
|
65
|
+
|
66
|
+
// TODO: make sure destroying one instance of mouse doesn't mess with
|
67
|
+
// other instances of mouse
|
68
|
+
_mouseDestroy: function() {
|
69
|
+
this.element.off( "." + this.widgetName );
|
70
|
+
if ( this._mouseMoveDelegate ) {
|
71
|
+
this.document
|
72
|
+
.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
|
73
|
+
.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
|
74
|
+
}
|
75
|
+
},
|
76
|
+
|
77
|
+
_mouseDown: function( event ) {
|
78
|
+
|
79
|
+
// don't let more than one widget handle mouseStart
|
80
|
+
if ( mouseHandled ) {
|
81
|
+
return;
|
82
|
+
}
|
83
|
+
|
84
|
+
this._mouseMoved = false;
|
85
|
+
|
86
|
+
// We may have missed mouseup (out of window)
|
87
|
+
( this._mouseStarted && this._mouseUp( event ) );
|
88
|
+
|
89
|
+
this._mouseDownEvent = event;
|
90
|
+
|
91
|
+
var that = this,
|
92
|
+
btnIsLeft = ( event.which === 1 ),
|
93
|
+
|
94
|
+
// event.target.nodeName works around a bug in IE 8 with
|
95
|
+
// disabled inputs (#7620)
|
96
|
+
elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ?
|
97
|
+
$( event.target ).closest( this.options.cancel ).length : false );
|
98
|
+
if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
|
99
|
+
return true;
|
100
|
+
}
|
101
|
+
|
102
|
+
this.mouseDelayMet = !this.options.delay;
|
103
|
+
if ( !this.mouseDelayMet ) {
|
104
|
+
this._mouseDelayTimer = setTimeout( function() {
|
105
|
+
that.mouseDelayMet = true;
|
106
|
+
}, this.options.delay );
|
107
|
+
}
|
108
|
+
|
109
|
+
if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
|
110
|
+
this._mouseStarted = ( this._mouseStart( event ) !== false );
|
111
|
+
if ( !this._mouseStarted ) {
|
112
|
+
event.preventDefault();
|
113
|
+
return true;
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
// Click event may never have fired (Gecko & Opera)
|
118
|
+
if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) {
|
119
|
+
$.removeData( event.target, this.widgetName + ".preventClickEvent" );
|
120
|
+
}
|
121
|
+
|
122
|
+
// These delegates are required to keep context
|
123
|
+
this._mouseMoveDelegate = function( event ) {
|
124
|
+
return that._mouseMove( event );
|
125
|
+
};
|
126
|
+
this._mouseUpDelegate = function( event ) {
|
127
|
+
return that._mouseUp( event );
|
128
|
+
};
|
129
|
+
|
130
|
+
this.document
|
131
|
+
.on( "mousemove." + this.widgetName, this._mouseMoveDelegate )
|
132
|
+
.on( "mouseup." + this.widgetName, this._mouseUpDelegate );
|
133
|
+
|
134
|
+
event.preventDefault();
|
135
|
+
|
136
|
+
mouseHandled = true;
|
137
|
+
return true;
|
138
|
+
},
|
139
|
+
|
140
|
+
_mouseMove: function( event ) {
|
141
|
+
|
142
|
+
// Only check for mouseups outside the document if you've moved inside the document
|
143
|
+
// at least once. This prevents the firing of mouseup in the case of IE<9, which will
|
144
|
+
// fire a mousemove event if content is placed under the cursor. See #7778
|
145
|
+
// Support: IE <9
|
146
|
+
if ( this._mouseMoved ) {
|
147
|
+
|
148
|
+
// IE mouseup check - mouseup happened when mouse was out of window
|
149
|
+
if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) &&
|
150
|
+
!event.button ) {
|
151
|
+
return this._mouseUp( event );
|
152
|
+
|
153
|
+
// Iframe mouseup check - mouseup occurred in another document
|
154
|
+
} else if ( !event.which ) {
|
155
|
+
|
156
|
+
// Support: Safari <=8 - 9
|
157
|
+
// Safari sets which to 0 if you press any of the following keys
|
158
|
+
// during a drag (#14461)
|
159
|
+
if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
|
160
|
+
event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
|
161
|
+
this.ignoreMissingWhich = true;
|
162
|
+
} else if ( !this.ignoreMissingWhich ) {
|
163
|
+
return this._mouseUp( event );
|
164
|
+
}
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
if ( event.which || event.button ) {
|
169
|
+
this._mouseMoved = true;
|
170
|
+
}
|
171
|
+
|
172
|
+
if ( this._mouseStarted ) {
|
173
|
+
this._mouseDrag( event );
|
174
|
+
return event.preventDefault();
|
175
|
+
}
|
176
|
+
|
177
|
+
if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
|
178
|
+
this._mouseStarted =
|
179
|
+
( this._mouseStart( this._mouseDownEvent, event ) !== false );
|
180
|
+
( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event ) );
|
181
|
+
}
|
182
|
+
|
183
|
+
return !this._mouseStarted;
|
184
|
+
},
|
185
|
+
|
186
|
+
_mouseUp: function( event ) {
|
187
|
+
this.document
|
188
|
+
.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
|
189
|
+
.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
|
190
|
+
|
191
|
+
if ( this._mouseStarted ) {
|
192
|
+
this._mouseStarted = false;
|
193
|
+
|
194
|
+
if ( event.target === this._mouseDownEvent.target ) {
|
195
|
+
$.data( event.target, this.widgetName + ".preventClickEvent", true );
|
196
|
+
}
|
197
|
+
|
198
|
+
this._mouseStop( event );
|
199
|
+
}
|
200
|
+
|
201
|
+
if ( this._mouseDelayTimer ) {
|
202
|
+
clearTimeout( this._mouseDelayTimer );
|
203
|
+
delete this._mouseDelayTimer;
|
204
|
+
}
|
205
|
+
|
206
|
+
this.ignoreMissingWhich = false;
|
207
|
+
mouseHandled = false;
|
208
|
+
event.preventDefault();
|
209
|
+
},
|
210
|
+
|
211
|
+
_mouseDistanceMet: function( event ) {
|
212
|
+
return ( Math.max(
|
213
|
+
Math.abs( this._mouseDownEvent.pageX - event.pageX ),
|
214
|
+
Math.abs( this._mouseDownEvent.pageY - event.pageY )
|
215
|
+
) >= this.options.distance
|
216
|
+
);
|
217
|
+
},
|
218
|
+
|
219
|
+
_mouseDelayMet: function( /* event */ ) {
|
220
|
+
return this.mouseDelayMet;
|
221
|
+
},
|
222
|
+
|
223
|
+
// These are placeholder methods, to be overriden by extending plugin
|
224
|
+
_mouseStart: function( /* event */ ) {},
|
225
|
+
_mouseDrag: function( /* event */ ) {},
|
226
|
+
_mouseStop: function( /* event */ ) {},
|
227
|
+
_mouseCapture: function( /* event */ ) { return true; }
|
228
|
+
} );
|
229
|
+
|
230
|
+
} ) );
|
@@ -1,35 +1,50 @@
|
|
1
|
-
//= require jquery-ui/
|
1
|
+
//= require jquery-ui/version
|
2
2
|
//= require jquery-ui/widget
|
3
3
|
|
4
4
|
/*!
|
5
|
-
* jQuery UI Progressbar 1.
|
5
|
+
* jQuery UI Progressbar 1.12.1
|
6
6
|
* http://jqueryui.com
|
7
7
|
*
|
8
8
|
* Copyright jQuery Foundation and other contributors
|
9
9
|
* Released under the MIT license.
|
10
10
|
* http://jquery.org/license
|
11
|
-
*
|
12
|
-
* http://api.jqueryui.com/progressbar/
|
13
11
|
*/
|
14
|
-
|
12
|
+
|
13
|
+
//>>label: Progressbar
|
14
|
+
//>>group: Widgets
|
15
|
+
// jscs:disable maximumLineLength
|
16
|
+
//>>description: Displays a status indicator for loading state, standard percentage, and other progress indicators.
|
17
|
+
// jscs:enable maximumLineLength
|
18
|
+
//>>docs: http://api.jqueryui.com/progressbar/
|
19
|
+
//>>demos: http://jqueryui.com/progressbar/
|
20
|
+
//>>css.structure: ../../themes/base/core.css
|
21
|
+
//>>css.structure: ../../themes/base/progressbar.css
|
22
|
+
//>>css.theme: ../../themes/base/theme.css
|
23
|
+
|
24
|
+
( function( factory ) {
|
15
25
|
if ( typeof define === "function" && define.amd ) {
|
16
26
|
|
17
27
|
// AMD. Register as an anonymous module.
|
18
|
-
define([
|
28
|
+
define( [
|
19
29
|
"jquery",
|
20
|
-
"
|
21
|
-
"
|
30
|
+
"../version",
|
31
|
+
"../widget"
|
22
32
|
], factory );
|
23
33
|
} else {
|
24
34
|
|
25
35
|
// Browser globals
|
26
36
|
factory( jQuery );
|
27
37
|
}
|
28
|
-
}(function( $ ) {
|
38
|
+
}( function( $ ) {
|
29
39
|
|
30
40
|
return $.widget( "ui.progressbar", {
|
31
|
-
version: "1.
|
41
|
+
version: "1.12.1",
|
32
42
|
options: {
|
43
|
+
classes: {
|
44
|
+
"ui-progressbar": "ui-corner-all",
|
45
|
+
"ui-progressbar-value": "ui-corner-left",
|
46
|
+
"ui-progressbar-complete": "ui-corner-right"
|
47
|
+
},
|
33
48
|
max: 100,
|
34
49
|
value: 0,
|
35
50
|
|
@@ -40,31 +55,26 @@ return $.widget( "ui.progressbar", {
|
|
40
55
|
min: 0,
|
41
56
|
|
42
57
|
_create: function() {
|
58
|
+
|
43
59
|
// Constrain initial value
|
44
60
|
this.oldValue = this.options.value = this._constrainedValue();
|
45
61
|
|
46
|
-
this.element
|
47
|
-
.addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
|
48
|
-
.attr({
|
49
|
-
// Only set static values, aria-valuenow and aria-valuemax are
|
50
|
-
// set inside _refreshValue()
|
51
|
-
role: "progressbar",
|
52
|
-
"aria-valuemin": this.min
|
53
|
-
});
|
62
|
+
this.element.attr( {
|
54
63
|
|
55
|
-
|
56
|
-
|
64
|
+
// Only set static values; aria-valuenow and aria-valuemax are
|
65
|
+
// set inside _refreshValue()
|
66
|
+
role: "progressbar",
|
67
|
+
"aria-valuemin": this.min
|
68
|
+
} );
|
69
|
+
this._addClass( "ui-progressbar", "ui-widget ui-widget-content" );
|
57
70
|
|
71
|
+
this.valueDiv = $( "<div>" ).appendTo( this.element );
|
72
|
+
this._addClass( this.valueDiv, "ui-progressbar-value", "ui-widget-header" );
|
58
73
|
this._refreshValue();
|
59
74
|
},
|
60
75
|
|
61
76
|
_destroy: function() {
|
62
|
-
this.element
|
63
|
-
.removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
|
64
|
-
.removeAttr( "role" )
|
65
|
-
.removeAttr( "aria-valuemin" )
|
66
|
-
.removeAttr( "aria-valuemax" )
|
67
|
-
.removeAttr( "aria-valuenow" );
|
77
|
+
this.element.removeAttr( "role aria-valuemin aria-valuemax aria-valuenow" );
|
68
78
|
|
69
79
|
this.valueDiv.remove();
|
70
80
|
},
|
@@ -85,7 +95,7 @@ return $.widget( "ui.progressbar", {
|
|
85
95
|
|
86
96
|
this.indeterminate = newValue === false;
|
87
97
|
|
88
|
-
//
|
98
|
+
// Sanitize value
|
89
99
|
if ( typeof newValue !== "number" ) {
|
90
100
|
newValue = 0;
|
91
101
|
}
|
@@ -95,6 +105,7 @@ return $.widget( "ui.progressbar", {
|
|
95
105
|
},
|
96
106
|
|
97
107
|
_setOptions: function( options ) {
|
108
|
+
|
98
109
|
// Ensure "value" option is set after other values (like max)
|
99
110
|
var value = options.value;
|
100
111
|
delete options.value;
|
@@ -107,19 +118,24 @@ return $.widget( "ui.progressbar", {
|
|
107
118
|
|
108
119
|
_setOption: function( key, value ) {
|
109
120
|
if ( key === "max" ) {
|
121
|
+
|
110
122
|
// Don't allow a max less than min
|
111
123
|
value = Math.max( this.min, value );
|
112
124
|
}
|
113
|
-
if ( key === "disabled" ) {
|
114
|
-
this.element
|
115
|
-
.toggleClass( "ui-state-disabled", !!value )
|
116
|
-
.attr( "aria-disabled", value );
|
117
|
-
}
|
118
125
|
this._super( key, value );
|
119
126
|
},
|
120
127
|
|
128
|
+
_setOptionDisabled: function( value ) {
|
129
|
+
this._super( value );
|
130
|
+
|
131
|
+
this.element.attr( "aria-disabled", value );
|
132
|
+
this._toggleClass( null, "ui-state-disabled", !!value );
|
133
|
+
},
|
134
|
+
|
121
135
|
_percentage: function() {
|
122
|
-
return this.indeterminate ?
|
136
|
+
return this.indeterminate ?
|
137
|
+
100 :
|
138
|
+
100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
|
123
139
|
},
|
124
140
|
|
125
141
|
_refreshValue: function() {
|
@@ -128,21 +144,24 @@ return $.widget( "ui.progressbar", {
|
|
128
144
|
|
129
145
|
this.valueDiv
|
130
146
|
.toggle( this.indeterminate || value > this.min )
|
131
|
-
.
|
132
|
-
.width( percentage.toFixed(0) + "%" );
|
147
|
+
.width( percentage.toFixed( 0 ) + "%" );
|
133
148
|
|
134
|
-
this
|
149
|
+
this
|
150
|
+
._toggleClass( this.valueDiv, "ui-progressbar-complete", null,
|
151
|
+
value === this.options.max )
|
152
|
+
._toggleClass( "ui-progressbar-indeterminate", null, this.indeterminate );
|
135
153
|
|
136
154
|
if ( this.indeterminate ) {
|
137
155
|
this.element.removeAttr( "aria-valuenow" );
|
138
156
|
if ( !this.overlayDiv ) {
|
139
|
-
this.overlayDiv = $( "<div
|
157
|
+
this.overlayDiv = $( "<div>" ).appendTo( this.valueDiv );
|
158
|
+
this._addClass( this.overlayDiv, "ui-progressbar-overlay" );
|
140
159
|
}
|
141
160
|
} else {
|
142
|
-
this.element.attr({
|
161
|
+
this.element.attr( {
|
143
162
|
"aria-valuemax": this.options.max,
|
144
163
|
"aria-valuenow": value
|
145
|
-
});
|
164
|
+
} );
|
146
165
|
if ( this.overlayDiv ) {
|
147
166
|
this.overlayDiv.remove();
|
148
167
|
this.overlayDiv = null;
|
@@ -157,6 +176,6 @@ return $.widget( "ui.progressbar", {
|
|
157
176
|
this._trigger( "complete" );
|
158
177
|
}
|
159
178
|
}
|
160
|
-
});
|
179
|
+
} );
|
161
180
|
|
162
|
-
}));
|
181
|
+
} ) );
|
@@ -1,36 +1,48 @@
|
|
1
|
-
//= require jquery-ui/
|
1
|
+
//= require jquery-ui/widgets/mouse
|
2
|
+
//= require jquery-ui/disable-selection
|
3
|
+
//= require jquery-ui/plugin
|
4
|
+
//= require jquery-ui/version
|
2
5
|
//= require jquery-ui/widget
|
3
|
-
//= require jquery-ui/mouse
|
4
6
|
|
5
7
|
/*!
|
6
|
-
* jQuery UI Resizable 1.
|
8
|
+
* jQuery UI Resizable 1.12.1
|
7
9
|
* http://jqueryui.com
|
8
10
|
*
|
9
11
|
* Copyright jQuery Foundation and other contributors
|
10
12
|
* Released under the MIT license.
|
11
13
|
* http://jquery.org/license
|
12
|
-
*
|
13
|
-
* http://api.jqueryui.com/resizable/
|
14
14
|
*/
|
15
|
-
|
15
|
+
|
16
|
+
//>>label: Resizable
|
17
|
+
//>>group: Interactions
|
18
|
+
//>>description: Enables resize functionality for any element.
|
19
|
+
//>>docs: http://api.jqueryui.com/resizable/
|
20
|
+
//>>demos: http://jqueryui.com/resizable/
|
21
|
+
//>>css.structure: ../../themes/base/core.css
|
22
|
+
//>>css.structure: ../../themes/base/resizable.css
|
23
|
+
//>>css.theme: ../../themes/base/theme.css
|
24
|
+
|
25
|
+
( function( factory ) {
|
16
26
|
if ( typeof define === "function" && define.amd ) {
|
17
27
|
|
18
28
|
// AMD. Register as an anonymous module.
|
19
|
-
define([
|
29
|
+
define( [
|
20
30
|
"jquery",
|
21
|
-
"./core",
|
22
31
|
"./mouse",
|
23
|
-
"
|
32
|
+
"../disable-selection",
|
33
|
+
"../plugin",
|
34
|
+
"../version",
|
35
|
+
"../widget"
|
24
36
|
], factory );
|
25
37
|
} else {
|
26
38
|
|
27
39
|
// Browser globals
|
28
40
|
factory( jQuery );
|
29
41
|
}
|
30
|
-
}(function( $ ) {
|
42
|
+
}( function( $ ) {
|
31
43
|
|
32
|
-
$.widget("ui.resizable", $.ui.mouse, {
|
33
|
-
version: "1.
|
44
|
+
$.widget( "ui.resizable", $.ui.mouse, {
|
45
|
+
version: "1.12.1",
|
34
46
|
widgetEventPrefix: "resize",
|
35
47
|
options: {
|
36
48
|
alsoResize: false,
|
@@ -39,6 +51,9 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
39
51
|
animateEasing: "swing",
|
40
52
|
aspectRatio: false,
|
41
53
|
autoHide: false,
|
54
|
+
classes: {
|
55
|
+
"ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se"
|
56
|
+
},
|
42
57
|
containment: false,
|
43
58
|
ghost: false,
|
44
59
|
grid: false,
|
@@ -48,26 +63,27 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
48
63
|
maxWidth: null,
|
49
64
|
minHeight: 10,
|
50
65
|
minWidth: 10,
|
66
|
+
|
51
67
|
// See #7960
|
52
68
|
zIndex: 90,
|
53
69
|
|
54
|
-
//
|
70
|
+
// Callbacks
|
55
71
|
resize: null,
|
56
72
|
start: null,
|
57
73
|
stop: null
|
58
74
|
},
|
59
75
|
|
60
76
|
_num: function( value ) {
|
61
|
-
return
|
77
|
+
return parseFloat( value ) || 0;
|
62
78
|
},
|
63
79
|
|
64
80
|
_isNumber: function( value ) {
|
65
|
-
return !isNaN(
|
81
|
+
return !isNaN( parseFloat( value ) );
|
66
82
|
},
|
67
83
|
|
68
84
|
_hasScroll: function( el, a ) {
|
69
85
|
|
70
|
-
if ( $( el ).css( "overflow" ) === "hidden") {
|
86
|
+
if ( $( el ).css( "overflow" ) === "hidden" ) {
|
71
87
|
return false;
|
72
88
|
}
|
73
89
|
|
@@ -89,30 +105,30 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
89
105
|
|
90
106
|
_create: function() {
|
91
107
|
|
92
|
-
var
|
93
|
-
|
94
|
-
|
95
|
-
this.
|
108
|
+
var margins,
|
109
|
+
o = this.options,
|
110
|
+
that = this;
|
111
|
+
this._addClass( "ui-resizable" );
|
96
112
|
|
97
|
-
$.extend(this, {
|
98
|
-
_aspectRatio: !!(o.aspectRatio),
|
113
|
+
$.extend( this, {
|
114
|
+
_aspectRatio: !!( o.aspectRatio ),
|
99
115
|
aspectRatio: o.aspectRatio,
|
100
116
|
originalElement: this.element,
|
101
117
|
_proportionallyResizeElements: [],
|
102
118
|
_helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
|
103
|
-
});
|
119
|
+
} );
|
104
120
|
|
105
121
|
// Wrap the element if it cannot hold child nodes
|
106
|
-
if (this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)) {
|
122
|
+
if ( this.element[ 0 ].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) ) {
|
107
123
|
|
108
124
|
this.element.wrap(
|
109
|
-
$("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
|
110
|
-
position: this.element.css("position"),
|
125
|
+
$( "<div class='ui-wrapper' style='overflow: hidden;'></div>" ).css( {
|
126
|
+
position: this.element.css( "position" ),
|
111
127
|
width: this.element.outerWidth(),
|
112
128
|
height: this.element.outerHeight(),
|
113
|
-
top: this.element.css("top"),
|
114
|
-
left: this.element.css("left")
|
115
|
-
})
|
129
|
+
top: this.element.css( "top" ),
|
130
|
+
left: this.element.css( "left" )
|
131
|
+
} )
|
116
132
|
);
|
117
133
|
|
118
134
|
this.element = this.element.parent().data(
|
@@ -121,38 +137,110 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
121
137
|
|
122
138
|
this.elementIsWrapper = true;
|
123
139
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
}
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
marginBottom: 0
|
135
|
-
});
|
140
|
+
margins = {
|
141
|
+
marginTop: this.originalElement.css( "marginTop" ),
|
142
|
+
marginRight: this.originalElement.css( "marginRight" ),
|
143
|
+
marginBottom: this.originalElement.css( "marginBottom" ),
|
144
|
+
marginLeft: this.originalElement.css( "marginLeft" )
|
145
|
+
};
|
146
|
+
|
147
|
+
this.element.css( margins );
|
148
|
+
this.originalElement.css( "margin", 0 );
|
149
|
+
|
136
150
|
// support: Safari
|
137
151
|
// Prevent Safari textarea resize
|
138
|
-
this.originalResizeStyle = this.originalElement.css("resize");
|
139
|
-
this.originalElement.css("resize", "none");
|
152
|
+
this.originalResizeStyle = this.originalElement.css( "resize" );
|
153
|
+
this.originalElement.css( "resize", "none" );
|
140
154
|
|
141
|
-
this._proportionallyResizeElements.push( this.originalElement.css({
|
155
|
+
this._proportionallyResizeElements.push( this.originalElement.css( {
|
142
156
|
position: "static",
|
143
157
|
zoom: 1,
|
144
158
|
display: "block"
|
145
|
-
}) );
|
159
|
+
} ) );
|
146
160
|
|
147
|
-
//
|
161
|
+
// Support: IE9
|
148
162
|
// avoid IE jump (hard set the margin)
|
149
|
-
this.originalElement.css(
|
163
|
+
this.originalElement.css( margins );
|
150
164
|
|
151
165
|
this._proportionallyResize();
|
152
166
|
}
|
153
167
|
|
168
|
+
this._setupHandles();
|
169
|
+
|
170
|
+
if ( o.autoHide ) {
|
171
|
+
$( this.element )
|
172
|
+
.on( "mouseenter", function() {
|
173
|
+
if ( o.disabled ) {
|
174
|
+
return;
|
175
|
+
}
|
176
|
+
that._removeClass( "ui-resizable-autohide" );
|
177
|
+
that._handles.show();
|
178
|
+
} )
|
179
|
+
.on( "mouseleave", function() {
|
180
|
+
if ( o.disabled ) {
|
181
|
+
return;
|
182
|
+
}
|
183
|
+
if ( !that.resizing ) {
|
184
|
+
that._addClass( "ui-resizable-autohide" );
|
185
|
+
that._handles.hide();
|
186
|
+
}
|
187
|
+
} );
|
188
|
+
}
|
189
|
+
|
190
|
+
this._mouseInit();
|
191
|
+
},
|
192
|
+
|
193
|
+
_destroy: function() {
|
194
|
+
|
195
|
+
this._mouseDestroy();
|
196
|
+
|
197
|
+
var wrapper,
|
198
|
+
_destroy = function( exp ) {
|
199
|
+
$( exp )
|
200
|
+
.removeData( "resizable" )
|
201
|
+
.removeData( "ui-resizable" )
|
202
|
+
.off( ".resizable" )
|
203
|
+
.find( ".ui-resizable-handle" )
|
204
|
+
.remove();
|
205
|
+
};
|
206
|
+
|
207
|
+
// TODO: Unwrap at same DOM position
|
208
|
+
if ( this.elementIsWrapper ) {
|
209
|
+
_destroy( this.element );
|
210
|
+
wrapper = this.element;
|
211
|
+
this.originalElement.css( {
|
212
|
+
position: wrapper.css( "position" ),
|
213
|
+
width: wrapper.outerWidth(),
|
214
|
+
height: wrapper.outerHeight(),
|
215
|
+
top: wrapper.css( "top" ),
|
216
|
+
left: wrapper.css( "left" )
|
217
|
+
} ).insertAfter( wrapper );
|
218
|
+
wrapper.remove();
|
219
|
+
}
|
220
|
+
|
221
|
+
this.originalElement.css( "resize", this.originalResizeStyle );
|
222
|
+
_destroy( this.originalElement );
|
223
|
+
|
224
|
+
return this;
|
225
|
+
},
|
226
|
+
|
227
|
+
_setOption: function( key, value ) {
|
228
|
+
this._super( key, value );
|
229
|
+
|
230
|
+
switch ( key ) {
|
231
|
+
case "handles":
|
232
|
+
this._removeHandles();
|
233
|
+
this._setupHandles();
|
234
|
+
break;
|
235
|
+
default:
|
236
|
+
break;
|
237
|
+
}
|
238
|
+
},
|
239
|
+
|
240
|
+
_setupHandles: function() {
|
241
|
+
var o = this.options, handle, i, n, hname, axis, that = this;
|
154
242
|
this.handles = o.handles ||
|
155
|
-
( !$(".ui-resizable-handle", this.element).length ?
|
243
|
+
( !$( ".ui-resizable-handle", this.element ).length ?
|
156
244
|
"e,s,se" : {
|
157
245
|
n: ".ui-resizable-n",
|
158
246
|
e: ".ui-resizable-e",
|
@@ -167,59 +255,59 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
167
255
|
this._handles = $();
|
168
256
|
if ( this.handles.constructor === String ) {
|
169
257
|
|
170
|
-
if ( this.handles === "all") {
|
258
|
+
if ( this.handles === "all" ) {
|
171
259
|
this.handles = "n,e,s,w,se,sw,ne,nw";
|
172
260
|
}
|
173
261
|
|
174
|
-
n = this.handles.split(",");
|
262
|
+
n = this.handles.split( "," );
|
175
263
|
this.handles = {};
|
176
264
|
|
177
|
-
for (i = 0; i < n.length; i++) {
|
265
|
+
for ( i = 0; i < n.length; i++ ) {
|
178
266
|
|
179
|
-
handle = $.trim(n[i]);
|
267
|
+
handle = $.trim( n[ i ] );
|
180
268
|
hname = "ui-resizable-" + handle;
|
181
|
-
axis = $("<div
|
182
|
-
|
183
|
-
axis.css({ zIndex: o.zIndex });
|
269
|
+
axis = $( "<div>" );
|
270
|
+
this._addClass( axis, "ui-resizable-handle " + hname );
|
184
271
|
|
185
|
-
|
186
|
-
if ("se" === handle) {
|
187
|
-
axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
|
188
|
-
}
|
272
|
+
axis.css( { zIndex: o.zIndex } );
|
189
273
|
|
190
|
-
this.handles[handle] = ".ui-resizable-" + handle;
|
191
|
-
this.element.append(axis);
|
274
|
+
this.handles[ handle ] = ".ui-resizable-" + handle;
|
275
|
+
this.element.append( axis );
|
192
276
|
}
|
193
277
|
|
194
278
|
}
|
195
279
|
|
196
|
-
this._renderAxis = function(target) {
|
280
|
+
this._renderAxis = function( target ) {
|
197
281
|
|
198
282
|
var i, axis, padPos, padWrapper;
|
199
283
|
|
200
284
|
target = target || this.element;
|
201
285
|
|
202
|
-
for (i in this.handles) {
|
286
|
+
for ( i in this.handles ) {
|
203
287
|
|
204
|
-
if (this.handles[i].constructor === String) {
|
205
|
-
this.handles[i] = this.element.children( this.handles[ i ] ).first().show();
|
288
|
+
if ( this.handles[ i ].constructor === String ) {
|
289
|
+
this.handles[ i ] = this.element.children( this.handles[ i ] ).first().show();
|
206
290
|
} else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
|
207
291
|
this.handles[ i ] = $( this.handles[ i ] );
|
208
|
-
this._on( this.handles[ i ], { "mousedown": that._mouseDown });
|
292
|
+
this._on( this.handles[ i ], { "mousedown": that._mouseDown } );
|
209
293
|
}
|
210
294
|
|
211
|
-
if (this.elementIsWrapper &&
|
295
|
+
if ( this.elementIsWrapper &&
|
296
|
+
this.originalElement[ 0 ]
|
297
|
+
.nodeName
|
298
|
+
.match( /^(textarea|input|select|button)$/i ) ) {
|
299
|
+
axis = $( this.handles[ i ], this.element );
|
212
300
|
|
213
|
-
|
214
|
-
|
215
|
-
|
301
|
+
padWrapper = /sw|ne|nw|se|n|s/.test( i ) ?
|
302
|
+
axis.outerHeight() :
|
303
|
+
axis.outerWidth();
|
216
304
|
|
217
305
|
padPos = [ "padding",
|
218
|
-
/ne|nw|n/.test(i) ? "Top" :
|
219
|
-
/se|sw|s/.test(i) ? "Bottom" :
|
220
|
-
/^e$/.test(i) ? "Right" : "Left" ].join("");
|
306
|
+
/ne|nw|n/.test( i ) ? "Top" :
|
307
|
+
/se|sw|s/.test( i ) ? "Bottom" :
|
308
|
+
/^e$/.test( i ) ? "Right" : "Left" ].join( "" );
|
221
309
|
|
222
|
-
target.css(padPos, padWrapper);
|
310
|
+
target.css( padPos, padWrapper );
|
223
311
|
|
224
312
|
this._proportionallyResize();
|
225
313
|
}
|
@@ -229,87 +317,37 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
229
317
|
};
|
230
318
|
|
231
319
|
// TODO: make renderAxis a prototype function
|
232
|
-
this._renderAxis(this.element);
|
320
|
+
this._renderAxis( this.element );
|
233
321
|
|
234
322
|
this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
|
235
323
|
this._handles.disableSelection();
|
236
324
|
|
237
|
-
this._handles.mouseover
|
238
|
-
if (!that.resizing) {
|
239
|
-
if (this.className) {
|
240
|
-
axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
|
325
|
+
this._handles.on( "mouseover", function() {
|
326
|
+
if ( !that.resizing ) {
|
327
|
+
if ( this.className ) {
|
328
|
+
axis = this.className.match( /ui-resizable-(se|sw|ne|nw|n|e|s|w)/i );
|
241
329
|
}
|
242
|
-
that.axis = axis && axis[1] ? axis[1] : "se";
|
330
|
+
that.axis = axis && axis[ 1 ] ? axis[ 1 ] : "se";
|
243
331
|
}
|
244
|
-
});
|
332
|
+
} );
|
245
333
|
|
246
|
-
if (o.autoHide) {
|
334
|
+
if ( o.autoHide ) {
|
247
335
|
this._handles.hide();
|
248
|
-
|
249
|
-
.addClass("ui-resizable-autohide")
|
250
|
-
.mouseenter(function() {
|
251
|
-
if (o.disabled) {
|
252
|
-
return;
|
253
|
-
}
|
254
|
-
$(this).removeClass("ui-resizable-autohide");
|
255
|
-
that._handles.show();
|
256
|
-
})
|
257
|
-
.mouseleave(function() {
|
258
|
-
if (o.disabled) {
|
259
|
-
return;
|
260
|
-
}
|
261
|
-
if (!that.resizing) {
|
262
|
-
$(this).addClass("ui-resizable-autohide");
|
263
|
-
that._handles.hide();
|
264
|
-
}
|
265
|
-
});
|
336
|
+
this._addClass( "ui-resizable-autohide" );
|
266
337
|
}
|
267
|
-
|
268
|
-
this._mouseInit();
|
269
338
|
},
|
270
339
|
|
271
|
-
|
272
|
-
|
273
|
-
this._mouseDestroy();
|
274
|
-
|
275
|
-
var wrapper,
|
276
|
-
_destroy = function(exp) {
|
277
|
-
$(exp)
|
278
|
-
.removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
|
279
|
-
.removeData("resizable")
|
280
|
-
.removeData("ui-resizable")
|
281
|
-
.unbind(".resizable")
|
282
|
-
.find(".ui-resizable-handle")
|
283
|
-
.remove();
|
284
|
-
};
|
285
|
-
|
286
|
-
// TODO: Unwrap at same DOM position
|
287
|
-
if (this.elementIsWrapper) {
|
288
|
-
_destroy(this.element);
|
289
|
-
wrapper = this.element;
|
290
|
-
this.originalElement.css({
|
291
|
-
position: wrapper.css("position"),
|
292
|
-
width: wrapper.outerWidth(),
|
293
|
-
height: wrapper.outerHeight(),
|
294
|
-
top: wrapper.css("top"),
|
295
|
-
left: wrapper.css("left")
|
296
|
-
}).insertAfter( wrapper );
|
297
|
-
wrapper.remove();
|
298
|
-
}
|
299
|
-
|
300
|
-
this.originalElement.css("resize", this.originalResizeStyle);
|
301
|
-
_destroy(this.originalElement);
|
302
|
-
|
303
|
-
return this;
|
340
|
+
_removeHandles: function() {
|
341
|
+
this._handles.remove();
|
304
342
|
},
|
305
343
|
|
306
|
-
_mouseCapture: function(event) {
|
344
|
+
_mouseCapture: function( event ) {
|
307
345
|
var i, handle,
|
308
346
|
capture = false;
|
309
347
|
|
310
|
-
for (i in this.handles) {
|
311
|
-
handle = $(this.handles[i])[0];
|
312
|
-
if (handle === event.target || $.contains(handle, event.target)) {
|
348
|
+
for ( i in this.handles ) {
|
349
|
+
handle = $( this.handles[ i ] )[ 0 ];
|
350
|
+
if ( handle === event.target || $.contains( handle, event.target ) ) {
|
313
351
|
capture = true;
|
314
352
|
}
|
315
353
|
}
|
@@ -317,7 +355,7 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
317
355
|
return !this.options.disabled && capture;
|
318
356
|
},
|
319
357
|
|
320
|
-
_mouseStart: function(event) {
|
358
|
+
_mouseStart: function( event ) {
|
321
359
|
|
322
360
|
var curleft, curtop, cursor,
|
323
361
|
o = this.options,
|
@@ -327,12 +365,12 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
327
365
|
|
328
366
|
this._renderProxy();
|
329
367
|
|
330
|
-
curleft = this._num(this.helper.css("left"));
|
331
|
-
curtop = this._num(this.helper.css("top"));
|
368
|
+
curleft = this._num( this.helper.css( "left" ) );
|
369
|
+
curtop = this._num( this.helper.css( "top" ) );
|
332
370
|
|
333
|
-
if (o.containment) {
|
334
|
-
curleft += $(o.containment).scrollLeft() || 0;
|
335
|
-
curtop += $(o.containment).scrollTop() || 0;
|
371
|
+
if ( o.containment ) {
|
372
|
+
curleft += $( o.containment ).scrollLeft() || 0;
|
373
|
+
curtop += $( o.containment ).scrollTop() || 0;
|
336
374
|
}
|
337
375
|
|
338
376
|
this.offset = this.helper.offset();
|
@@ -362,45 +400,45 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
362
400
|
this.originalPosition = { left: curleft, top: curtop };
|
363
401
|
this.originalMousePosition = { left: event.pageX, top: event.pageY };
|
364
402
|
|
365
|
-
this.aspectRatio = (typeof o.aspectRatio === "number") ?
|
403
|
+
this.aspectRatio = ( typeof o.aspectRatio === "number" ) ?
|
366
404
|
o.aspectRatio :
|
367
|
-
((this.originalSize.width / this.originalSize.height) || 1);
|
405
|
+
( ( this.originalSize.width / this.originalSize.height ) || 1 );
|
368
406
|
|
369
|
-
cursor = $(".ui-resizable-" + this.axis).css("cursor");
|
370
|
-
$("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
|
407
|
+
cursor = $( ".ui-resizable-" + this.axis ).css( "cursor" );
|
408
|
+
$( "body" ).css( "cursor", cursor === "auto" ? this.axis + "-resize" : cursor );
|
371
409
|
|
372
|
-
|
373
|
-
this._propagate("start", event);
|
410
|
+
this._addClass( "ui-resizable-resizing" );
|
411
|
+
this._propagate( "start", event );
|
374
412
|
return true;
|
375
413
|
},
|
376
414
|
|
377
|
-
_mouseDrag: function(event) {
|
415
|
+
_mouseDrag: function( event ) {
|
378
416
|
|
379
417
|
var data, props,
|
380
418
|
smp = this.originalMousePosition,
|
381
419
|
a = this.axis,
|
382
|
-
dx = (event.pageX - smp.left) || 0,
|
383
|
-
dy = (event.pageY - smp.top) || 0,
|
384
|
-
trigger = this._change[a];
|
420
|
+
dx = ( event.pageX - smp.left ) || 0,
|
421
|
+
dy = ( event.pageY - smp.top ) || 0,
|
422
|
+
trigger = this._change[ a ];
|
385
423
|
|
386
424
|
this._updatePrevProperties();
|
387
425
|
|
388
|
-
if (!trigger) {
|
426
|
+
if ( !trigger ) {
|
389
427
|
return false;
|
390
428
|
}
|
391
429
|
|
392
|
-
data = trigger.apply(this, [ event, dx, dy ]);
|
430
|
+
data = trigger.apply( this, [ event, dx, dy ] );
|
393
431
|
|
394
|
-
this._updateVirtualBoundaries(event.shiftKey);
|
395
|
-
if (this._aspectRatio || event.shiftKey) {
|
396
|
-
data = this._updateRatio(data, event);
|
432
|
+
this._updateVirtualBoundaries( event.shiftKey );
|
433
|
+
if ( this._aspectRatio || event.shiftKey ) {
|
434
|
+
data = this._updateRatio( data, event );
|
397
435
|
}
|
398
436
|
|
399
|
-
data = this._respectSize(data, event);
|
437
|
+
data = this._respectSize( data, event );
|
400
438
|
|
401
|
-
this._updateCache(data);
|
439
|
+
this._updateCache( data );
|
402
440
|
|
403
|
-
this._propagate("resize", event);
|
441
|
+
this._propagate( "resize", event );
|
404
442
|
|
405
443
|
props = this._applyChanges();
|
406
444
|
|
@@ -417,47 +455,47 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
417
455
|
return false;
|
418
456
|
},
|
419
457
|
|
420
|
-
_mouseStop: function(event) {
|
458
|
+
_mouseStop: function( event ) {
|
421
459
|
|
422
460
|
this.resizing = false;
|
423
461
|
var pr, ista, soffseth, soffsetw, s, left, top,
|
424
462
|
o = this.options, that = this;
|
425
463
|
|
426
|
-
if (this._helper) {
|
464
|
+
if ( this._helper ) {
|
427
465
|
|
428
466
|
pr = this._proportionallyResizeElements;
|
429
|
-
ista = pr.length && (/textarea/i).test(pr[0].nodeName);
|
430
|
-
soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
|
467
|
+
ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName );
|
468
|
+
soffseth = ista && this._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height;
|
431
469
|
soffsetw = ista ? 0 : that.sizeDiff.width;
|
432
470
|
|
433
471
|
s = {
|
434
|
-
width: (that.helper.width() - soffsetw),
|
435
|
-
height: (that.helper.height() - soffseth)
|
472
|
+
width: ( that.helper.width() - soffsetw ),
|
473
|
+
height: ( that.helper.height() - soffseth )
|
436
474
|
};
|
437
|
-
left = (
|
438
|
-
(that.position.left - that.originalPosition.left)) || null;
|
439
|
-
top = (
|
440
|
-
(that.position.top - that.originalPosition.top)) || null;
|
475
|
+
left = ( parseFloat( that.element.css( "left" ) ) +
|
476
|
+
( that.position.left - that.originalPosition.left ) ) || null;
|
477
|
+
top = ( parseFloat( that.element.css( "top" ) ) +
|
478
|
+
( that.position.top - that.originalPosition.top ) ) || null;
|
441
479
|
|
442
|
-
if (!o.animate) {
|
443
|
-
this.element.css($.extend(s, { top: top, left: left }));
|
480
|
+
if ( !o.animate ) {
|
481
|
+
this.element.css( $.extend( s, { top: top, left: left } ) );
|
444
482
|
}
|
445
483
|
|
446
|
-
that.helper.height(that.size.height);
|
447
|
-
that.helper.width(that.size.width);
|
484
|
+
that.helper.height( that.size.height );
|
485
|
+
that.helper.width( that.size.width );
|
448
486
|
|
449
|
-
if (this._helper && !o.animate) {
|
487
|
+
if ( this._helper && !o.animate ) {
|
450
488
|
this._proportionallyResize();
|
451
489
|
}
|
452
490
|
}
|
453
491
|
|
454
|
-
$("body").css("cursor", "auto");
|
492
|
+
$( "body" ).css( "cursor", "auto" );
|
455
493
|
|
456
|
-
this.
|
494
|
+
this._removeClass( "ui-resizable-resizing" );
|
457
495
|
|
458
|
-
this._propagate("stop", event);
|
496
|
+
this._propagate( "stop", event );
|
459
497
|
|
460
|
-
if (this._helper) {
|
498
|
+
if ( this._helper ) {
|
461
499
|
this.helper.remove();
|
462
500
|
}
|
463
501
|
|
@@ -497,51 +535,51 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
497
535
|
return props;
|
498
536
|
},
|
499
537
|
|
500
|
-
_updateVirtualBoundaries: function(forceAspectRatio) {
|
538
|
+
_updateVirtualBoundaries: function( forceAspectRatio ) {
|
501
539
|
var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
|
502
540
|
o = this.options;
|
503
541
|
|
504
542
|
b = {
|
505
|
-
minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
|
506
|
-
maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
|
507
|
-
minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
|
508
|
-
maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
|
543
|
+
minWidth: this._isNumber( o.minWidth ) ? o.minWidth : 0,
|
544
|
+
maxWidth: this._isNumber( o.maxWidth ) ? o.maxWidth : Infinity,
|
545
|
+
minHeight: this._isNumber( o.minHeight ) ? o.minHeight : 0,
|
546
|
+
maxHeight: this._isNumber( o.maxHeight ) ? o.maxHeight : Infinity
|
509
547
|
};
|
510
548
|
|
511
|
-
if (this._aspectRatio || forceAspectRatio) {
|
549
|
+
if ( this._aspectRatio || forceAspectRatio ) {
|
512
550
|
pMinWidth = b.minHeight * this.aspectRatio;
|
513
551
|
pMinHeight = b.minWidth / this.aspectRatio;
|
514
552
|
pMaxWidth = b.maxHeight * this.aspectRatio;
|
515
553
|
pMaxHeight = b.maxWidth / this.aspectRatio;
|
516
554
|
|
517
|
-
if (pMinWidth > b.minWidth) {
|
555
|
+
if ( pMinWidth > b.minWidth ) {
|
518
556
|
b.minWidth = pMinWidth;
|
519
557
|
}
|
520
|
-
if (pMinHeight > b.minHeight) {
|
558
|
+
if ( pMinHeight > b.minHeight ) {
|
521
559
|
b.minHeight = pMinHeight;
|
522
560
|
}
|
523
|
-
if (pMaxWidth < b.maxWidth) {
|
561
|
+
if ( pMaxWidth < b.maxWidth ) {
|
524
562
|
b.maxWidth = pMaxWidth;
|
525
563
|
}
|
526
|
-
if (pMaxHeight < b.maxHeight) {
|
564
|
+
if ( pMaxHeight < b.maxHeight ) {
|
527
565
|
b.maxHeight = pMaxHeight;
|
528
566
|
}
|
529
567
|
}
|
530
568
|
this._vBoundaries = b;
|
531
569
|
},
|
532
570
|
|
533
|
-
_updateCache: function(data) {
|
571
|
+
_updateCache: function( data ) {
|
534
572
|
this.offset = this.helper.offset();
|
535
|
-
if (this._isNumber(data.left)) {
|
573
|
+
if ( this._isNumber( data.left ) ) {
|
536
574
|
this.position.left = data.left;
|
537
575
|
}
|
538
|
-
if (this._isNumber(data.top)) {
|
576
|
+
if ( this._isNumber( data.top ) ) {
|
539
577
|
this.position.top = data.top;
|
540
578
|
}
|
541
|
-
if (this._isNumber(data.height)) {
|
579
|
+
if ( this._isNumber( data.height ) ) {
|
542
580
|
this.size.height = data.height;
|
543
581
|
}
|
544
|
-
if (this._isNumber(data.width)) {
|
582
|
+
if ( this._isNumber( data.width ) ) {
|
545
583
|
this.size.width = data.width;
|
546
584
|
}
|
547
585
|
},
|
@@ -552,19 +590,19 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
552
590
|
csize = this.size,
|
553
591
|
a = this.axis;
|
554
592
|
|
555
|
-
if (this._isNumber(data.height)) {
|
556
|
-
data.width = (data.height * this.aspectRatio);
|
557
|
-
} else if (this._isNumber(data.width)) {
|
558
|
-
data.height = (data.width / this.aspectRatio);
|
593
|
+
if ( this._isNumber( data.height ) ) {
|
594
|
+
data.width = ( data.height * this.aspectRatio );
|
595
|
+
} else if ( this._isNumber( data.width ) ) {
|
596
|
+
data.height = ( data.width / this.aspectRatio );
|
559
597
|
}
|
560
598
|
|
561
|
-
if (a === "sw") {
|
562
|
-
data.left = cpos.left + (csize.width - data.width);
|
599
|
+
if ( a === "sw" ) {
|
600
|
+
data.left = cpos.left + ( csize.width - data.width );
|
563
601
|
data.top = null;
|
564
602
|
}
|
565
|
-
if (a === "nw") {
|
566
|
-
data.top = cpos.top + (csize.height - data.height);
|
567
|
-
data.left = cpos.left + (csize.width - data.width);
|
603
|
+
if ( a === "nw" ) {
|
604
|
+
data.top = cpos.top + ( csize.height - data.height );
|
605
|
+
data.left = cpos.left + ( csize.width - data.width );
|
568
606
|
}
|
569
607
|
|
570
608
|
return data;
|
@@ -574,43 +612,43 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
574
612
|
|
575
613
|
var o = this._vBoundaries,
|
576
614
|
a = this.axis,
|
577
|
-
ismaxw = this._isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width),
|
578
|
-
ismaxh = this._isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
|
579
|
-
isminw = this._isNumber(data.width) && o.minWidth && (o.minWidth > data.width),
|
580
|
-
isminh = this._isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
|
615
|
+
ismaxw = this._isNumber( data.width ) && o.maxWidth && ( o.maxWidth < data.width ),
|
616
|
+
ismaxh = this._isNumber( data.height ) && o.maxHeight && ( o.maxHeight < data.height ),
|
617
|
+
isminw = this._isNumber( data.width ) && o.minWidth && ( o.minWidth > data.width ),
|
618
|
+
isminh = this._isNumber( data.height ) && o.minHeight && ( o.minHeight > data.height ),
|
581
619
|
dw = this.originalPosition.left + this.originalSize.width,
|
582
|
-
dh = this.
|
583
|
-
cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
|
584
|
-
if (isminw) {
|
620
|
+
dh = this.originalPosition.top + this.originalSize.height,
|
621
|
+
cw = /sw|nw|w/.test( a ), ch = /nw|ne|n/.test( a );
|
622
|
+
if ( isminw ) {
|
585
623
|
data.width = o.minWidth;
|
586
624
|
}
|
587
|
-
if (isminh) {
|
625
|
+
if ( isminh ) {
|
588
626
|
data.height = o.minHeight;
|
589
627
|
}
|
590
|
-
if (ismaxw) {
|
628
|
+
if ( ismaxw ) {
|
591
629
|
data.width = o.maxWidth;
|
592
630
|
}
|
593
|
-
if (ismaxh) {
|
631
|
+
if ( ismaxh ) {
|
594
632
|
data.height = o.maxHeight;
|
595
633
|
}
|
596
634
|
|
597
|
-
if (isminw && cw) {
|
635
|
+
if ( isminw && cw ) {
|
598
636
|
data.left = dw - o.minWidth;
|
599
637
|
}
|
600
|
-
if (ismaxw && cw) {
|
638
|
+
if ( ismaxw && cw ) {
|
601
639
|
data.left = dw - o.maxWidth;
|
602
640
|
}
|
603
|
-
if (isminh && ch) {
|
641
|
+
if ( isminh && ch ) {
|
604
642
|
data.top = dh - o.minHeight;
|
605
643
|
}
|
606
|
-
if (ismaxh && ch) {
|
644
|
+
if ( ismaxh && ch ) {
|
607
645
|
data.top = dh - o.maxHeight;
|
608
646
|
}
|
609
647
|
|
610
648
|
// Fixing jump error on top/left - bug #2330
|
611
|
-
if (!data.width && !data.height && !data.left && data.top) {
|
649
|
+
if ( !data.width && !data.height && !data.left && data.top ) {
|
612
650
|
data.top = null;
|
613
|
-
} else if (!data.width && !data.height && !data.top && data.left) {
|
651
|
+
} else if ( !data.width && !data.height && !data.top && data.left ) {
|
614
652
|
data.left = null;
|
615
653
|
}
|
616
654
|
|
@@ -634,8 +672,8 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
634
672
|
];
|
635
673
|
|
636
674
|
for ( ; i < 4; i++ ) {
|
637
|
-
widths[ i ] = (
|
638
|
-
widths[ i ] += (
|
675
|
+
widths[ i ] = ( parseFloat( borders[ i ] ) || 0 );
|
676
|
+
widths[ i ] += ( parseFloat( paddings[ i ] ) || 0 );
|
639
677
|
}
|
640
678
|
|
641
679
|
return {
|
@@ -646,7 +684,7 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
646
684
|
|
647
685
|
_proportionallyResize: function() {
|
648
686
|
|
649
|
-
if (!this._proportionallyResizeElements.length) {
|
687
|
+
if ( !this._proportionallyResizeElements.length ) {
|
650
688
|
return;
|
651
689
|
}
|
652
690
|
|
@@ -654,20 +692,20 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
654
692
|
i = 0,
|
655
693
|
element = this.helper || this.element;
|
656
694
|
|
657
|
-
for ( ; i < this._proportionallyResizeElements.length; i++) {
|
695
|
+
for ( ; i < this._proportionallyResizeElements.length; i++ ) {
|
658
696
|
|
659
|
-
prel = this._proportionallyResizeElements[i];
|
697
|
+
prel = this._proportionallyResizeElements[ i ];
|
660
698
|
|
661
699
|
// TODO: Seems like a bug to cache this.outerDimensions
|
662
700
|
// considering that we are in a loop.
|
663
|
-
if (!this.outerDimensions) {
|
701
|
+
if ( !this.outerDimensions ) {
|
664
702
|
this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
|
665
703
|
}
|
666
704
|
|
667
|
-
prel.css({
|
668
|
-
height: (element.height() - this.outerDimensions.height) || 0,
|
669
|
-
width: (element.width() - this.outerDimensions.width) || 0
|
670
|
-
});
|
705
|
+
prel.css( {
|
706
|
+
height: ( element.height() - this.outerDimensions.height ) || 0,
|
707
|
+
width: ( element.width() - this.outerDimensions.width ) || 0
|
708
|
+
} );
|
671
709
|
|
672
710
|
}
|
673
711
|
|
@@ -678,21 +716,22 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
678
716
|
var el = this.element, o = this.options;
|
679
717
|
this.elementOffset = el.offset();
|
680
718
|
|
681
|
-
if (this._helper) {
|
719
|
+
if ( this._helper ) {
|
682
720
|
|
683
|
-
this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
|
721
|
+
this.helper = this.helper || $( "<div style='overflow:hidden;'></div>" );
|
684
722
|
|
685
|
-
this.
|
686
|
-
|
687
|
-
|
723
|
+
this._addClass( this.helper, this._helper );
|
724
|
+
this.helper.css( {
|
725
|
+
width: this.element.outerWidth(),
|
726
|
+
height: this.element.outerHeight(),
|
688
727
|
position: "absolute",
|
689
728
|
left: this.elementOffset.left + "px",
|
690
729
|
top: this.elementOffset.top + "px",
|
691
730
|
zIndex: ++o.zIndex //TODO: Don't modify option
|
692
|
-
});
|
731
|
+
} );
|
693
732
|
|
694
733
|
this.helper
|
695
|
-
.appendTo("body")
|
734
|
+
.appendTo( "body" )
|
696
735
|
.disableSelection();
|
697
736
|
|
698
737
|
} else {
|
@@ -702,41 +741,41 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
702
741
|
},
|
703
742
|
|
704
743
|
_change: {
|
705
|
-
e: function(event, dx) {
|
744
|
+
e: function( event, dx ) {
|
706
745
|
return { width: this.originalSize.width + dx };
|
707
746
|
},
|
708
|
-
w: function(event, dx) {
|
747
|
+
w: function( event, dx ) {
|
709
748
|
var cs = this.originalSize, sp = this.originalPosition;
|
710
749
|
return { left: sp.left + dx, width: cs.width - dx };
|
711
750
|
},
|
712
|
-
n: function(event, dx, dy) {
|
751
|
+
n: function( event, dx, dy ) {
|
713
752
|
var cs = this.originalSize, sp = this.originalPosition;
|
714
753
|
return { top: sp.top + dy, height: cs.height - dy };
|
715
754
|
},
|
716
|
-
s: function(event, dx, dy) {
|
755
|
+
s: function( event, dx, dy ) {
|
717
756
|
return { height: this.originalSize.height + dy };
|
718
757
|
},
|
719
|
-
se: function(event, dx, dy) {
|
720
|
-
return $.extend(this._change.s.apply(this, arguments),
|
721
|
-
this._change.e.apply(this, [ event, dx, dy ]));
|
758
|
+
se: function( event, dx, dy ) {
|
759
|
+
return $.extend( this._change.s.apply( this, arguments ),
|
760
|
+
this._change.e.apply( this, [ event, dx, dy ] ) );
|
722
761
|
},
|
723
|
-
sw: function(event, dx, dy) {
|
724
|
-
return $.extend(this._change.s.apply(this, arguments),
|
725
|
-
this._change.w.apply(this, [ event, dx, dy ]));
|
762
|
+
sw: function( event, dx, dy ) {
|
763
|
+
return $.extend( this._change.s.apply( this, arguments ),
|
764
|
+
this._change.w.apply( this, [ event, dx, dy ] ) );
|
726
765
|
},
|
727
|
-
ne: function(event, dx, dy) {
|
728
|
-
return $.extend(this._change.n.apply(this, arguments),
|
729
|
-
this._change.e.apply(this, [ event, dx, dy ]));
|
766
|
+
ne: function( event, dx, dy ) {
|
767
|
+
return $.extend( this._change.n.apply( this, arguments ),
|
768
|
+
this._change.e.apply( this, [ event, dx, dy ] ) );
|
730
769
|
},
|
731
|
-
nw: function(event, dx, dy) {
|
732
|
-
return $.extend(this._change.n.apply(this, arguments),
|
733
|
-
this._change.w.apply(this, [ event, dx, dy ]));
|
770
|
+
nw: function( event, dx, dy ) {
|
771
|
+
return $.extend( this._change.n.apply( this, arguments ),
|
772
|
+
this._change.w.apply( this, [ event, dx, dy ] ) );
|
734
773
|
}
|
735
774
|
},
|
736
775
|
|
737
|
-
_propagate: function(n, event) {
|
738
|
-
$.ui.plugin.call(this, n, [ event, this.ui() ]);
|
739
|
-
(n !== "resize" && this._trigger(n, event, this.ui()));
|
776
|
+
_propagate: function( n, event ) {
|
777
|
+
$.ui.plugin.call( this, n, [ event, this.ui() ] );
|
778
|
+
( n !== "resize" && this._trigger( n, event, this.ui() ) );
|
740
779
|
},
|
741
780
|
|
742
781
|
plugins: {},
|
@@ -753,54 +792,57 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|
753
792
|
};
|
754
793
|
}
|
755
794
|
|
756
|
-
});
|
795
|
+
} );
|
757
796
|
|
758
797
|
/*
|
759
798
|
* Resizable Extensions
|
760
799
|
*/
|
761
800
|
|
762
|
-
$.ui.plugin.add("resizable", "animate", {
|
801
|
+
$.ui.plugin.add( "resizable", "animate", {
|
763
802
|
|
764
803
|
stop: function( event ) {
|
765
|
-
var that = $(this).resizable( "instance" ),
|
804
|
+
var that = $( this ).resizable( "instance" ),
|
766
805
|
o = that.options,
|
767
806
|
pr = that._proportionallyResizeElements,
|
768
|
-
ista = pr.length && (/textarea/i).test(pr[0].nodeName),
|
769
|
-
soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height,
|
807
|
+
ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ),
|
808
|
+
soffseth = ista && that._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height,
|
770
809
|
soffsetw = ista ? 0 : that.sizeDiff.width,
|
771
|
-
style = {
|
772
|
-
|
773
|
-
(that.
|
774
|
-
|
775
|
-
|
810
|
+
style = {
|
811
|
+
width: ( that.size.width - soffsetw ),
|
812
|
+
height: ( that.size.height - soffseth )
|
813
|
+
},
|
814
|
+
left = ( parseFloat( that.element.css( "left" ) ) +
|
815
|
+
( that.position.left - that.originalPosition.left ) ) || null,
|
816
|
+
top = ( parseFloat( that.element.css( "top" ) ) +
|
817
|
+
( that.position.top - that.originalPosition.top ) ) || null;
|
776
818
|
|
777
819
|
that.element.animate(
|
778
|
-
$.extend(style, top && left ? { top: top, left: left } : {}), {
|
820
|
+
$.extend( style, top && left ? { top: top, left: left } : {} ), {
|
779
821
|
duration: o.animateDuration,
|
780
822
|
easing: o.animateEasing,
|
781
823
|
step: function() {
|
782
824
|
|
783
825
|
var data = {
|
784
|
-
width:
|
785
|
-
height:
|
786
|
-
top:
|
787
|
-
left:
|
826
|
+
width: parseFloat( that.element.css( "width" ) ),
|
827
|
+
height: parseFloat( that.element.css( "height" ) ),
|
828
|
+
top: parseFloat( that.element.css( "top" ) ),
|
829
|
+
left: parseFloat( that.element.css( "left" ) )
|
788
830
|
};
|
789
831
|
|
790
|
-
if (pr && pr.length) {
|
791
|
-
$(pr[0]).css({ width: data.width, height: data.height });
|
832
|
+
if ( pr && pr.length ) {
|
833
|
+
$( pr[ 0 ] ).css( { width: data.width, height: data.height } );
|
792
834
|
}
|
793
835
|
|
794
|
-
//
|
795
|
-
that._updateCache(data);
|
796
|
-
that._propagate("resize", event);
|
836
|
+
// Propagating resize, and updating values for each animation step
|
837
|
+
that._updateCache( data );
|
838
|
+
that._propagate( "resize", event );
|
797
839
|
|
798
840
|
}
|
799
841
|
}
|
800
842
|
);
|
801
843
|
}
|
802
844
|
|
803
|
-
});
|
845
|
+
} );
|
804
846
|
|
805
847
|
$.ui.plugin.add( "resizable", "containment", {
|
806
848
|
|
@@ -810,7 +852,9 @@ $.ui.plugin.add( "resizable", "containment", {
|
|
810
852
|
o = that.options,
|
811
853
|
el = that.element,
|
812
854
|
oc = o.containment,
|
813
|
-
ce = ( oc instanceof $ ) ?
|
855
|
+
ce = ( oc instanceof $ ) ?
|
856
|
+
oc.get( 0 ) :
|
857
|
+
( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
|
814
858
|
|
815
859
|
if ( !ce ) {
|
816
860
|
return;
|
@@ -838,9 +882,9 @@ $.ui.plugin.add( "resizable", "containment", {
|
|
838
882
|
} else {
|
839
883
|
element = $( ce );
|
840
884
|
p = [];
|
841
|
-
$([ "Top", "Right", "Left", "Bottom" ]).each(function( i, name ) {
|
885
|
+
$( [ "Top", "Right", "Left", "Bottom" ] ).each( function( i, name ) {
|
842
886
|
p[ i ] = that._num( element.css( "padding" + name ) );
|
843
|
-
});
|
887
|
+
} );
|
844
888
|
|
845
889
|
that.containerOffset = element.offset();
|
846
890
|
that.containerPosition = element.position();
|
@@ -921,14 +965,14 @@ $.ui.plugin.add( "resizable", "containment", {
|
|
921
965
|
}
|
922
966
|
|
923
967
|
woset = Math.abs( that.sizeDiff.width +
|
924
|
-
(that._helper ?
|
968
|
+
( that._helper ?
|
925
969
|
that.offset.left - cop.left :
|
926
|
-
(that.offset.left - co.left)) );
|
970
|
+
( that.offset.left - co.left ) ) );
|
927
971
|
|
928
972
|
hoset = Math.abs( that.sizeDiff.height +
|
929
|
-
(that._helper ?
|
973
|
+
( that._helper ?
|
930
974
|
that.offset.top - cop.top :
|
931
|
-
(that.offset.top - co.top)) );
|
975
|
+
( that.offset.top - co.top ) ) );
|
932
976
|
|
933
977
|
if ( woset + that.size.width >= that.parentData.width ) {
|
934
978
|
that.size.width = that.parentData.width - woset;
|
@@ -966,167 +1010,174 @@ $.ui.plugin.add( "resizable", "containment", {
|
|
966
1010
|
h = helper.outerHeight() - that.sizeDiff.height;
|
967
1011
|
|
968
1012
|
if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
|
969
|
-
$( this ).css({
|
1013
|
+
$( this ).css( {
|
970
1014
|
left: ho.left - cop.left - co.left,
|
971
1015
|
width: w,
|
972
1016
|
height: h
|
973
|
-
});
|
1017
|
+
} );
|
974
1018
|
}
|
975
1019
|
|
976
1020
|
if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
|
977
|
-
$( this ).css({
|
1021
|
+
$( this ).css( {
|
978
1022
|
left: ho.left - cop.left - co.left,
|
979
1023
|
width: w,
|
980
1024
|
height: h
|
981
|
-
});
|
1025
|
+
} );
|
982
1026
|
}
|
983
1027
|
}
|
984
|
-
});
|
1028
|
+
} );
|
985
1029
|
|
986
|
-
$.ui.plugin.add("resizable", "alsoResize", {
|
1030
|
+
$.ui.plugin.add( "resizable", "alsoResize", {
|
987
1031
|
|
988
1032
|
start: function() {
|
989
|
-
var that = $(this).resizable( "instance" ),
|
1033
|
+
var that = $( this ).resizable( "instance" ),
|
990
1034
|
o = that.options;
|
991
1035
|
|
992
|
-
$(o.alsoResize).each(function() {
|
993
|
-
var el = $(this);
|
994
|
-
el.data("ui-resizable-alsoresize", {
|
995
|
-
width:
|
996
|
-
left:
|
997
|
-
});
|
998
|
-
});
|
1036
|
+
$( o.alsoResize ).each( function() {
|
1037
|
+
var el = $( this );
|
1038
|
+
el.data( "ui-resizable-alsoresize", {
|
1039
|
+
width: parseFloat( el.width() ), height: parseFloat( el.height() ),
|
1040
|
+
left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) )
|
1041
|
+
} );
|
1042
|
+
} );
|
999
1043
|
},
|
1000
1044
|
|
1001
|
-
resize: function(event, ui) {
|
1002
|
-
var that = $(this).resizable( "instance" ),
|
1045
|
+
resize: function( event, ui ) {
|
1046
|
+
var that = $( this ).resizable( "instance" ),
|
1003
1047
|
o = that.options,
|
1004
1048
|
os = that.originalSize,
|
1005
1049
|
op = that.originalPosition,
|
1006
1050
|
delta = {
|
1007
|
-
height: (that.size.height - os.height) || 0,
|
1008
|
-
width: (that.size.width - os.width) || 0,
|
1009
|
-
top: (that.position.top - op.top) || 0,
|
1010
|
-
left: (that.position.left - op.left) || 0
|
1051
|
+
height: ( that.size.height - os.height ) || 0,
|
1052
|
+
width: ( that.size.width - os.width ) || 0,
|
1053
|
+
top: ( that.position.top - op.top ) || 0,
|
1054
|
+
left: ( that.position.left - op.left ) || 0
|
1011
1055
|
};
|
1012
1056
|
|
1013
|
-
$(o.alsoResize).each(function() {
|
1014
|
-
var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
|
1015
|
-
css = el.parents(ui.originalElement[0]).length ?
|
1057
|
+
$( o.alsoResize ).each( function() {
|
1058
|
+
var el = $( this ), start = $( this ).data( "ui-resizable-alsoresize" ), style = {},
|
1059
|
+
css = el.parents( ui.originalElement[ 0 ] ).length ?
|
1016
1060
|
[ "width", "height" ] :
|
1017
1061
|
[ "width", "height", "top", "left" ];
|
1018
1062
|
|
1019
|
-
$.each(css, function(i, prop) {
|
1020
|
-
var sum = (start[prop] || 0) + (delta[prop] || 0);
|
1021
|
-
if (sum && sum >= 0) {
|
1022
|
-
style[prop] = sum || null;
|
1063
|
+
$.each( css, function( i, prop ) {
|
1064
|
+
var sum = ( start[ prop ] || 0 ) + ( delta[ prop ] || 0 );
|
1065
|
+
if ( sum && sum >= 0 ) {
|
1066
|
+
style[ prop ] = sum || null;
|
1023
1067
|
}
|
1024
|
-
});
|
1068
|
+
} );
|
1025
1069
|
|
1026
|
-
el.css(style);
|
1027
|
-
});
|
1070
|
+
el.css( style );
|
1071
|
+
} );
|
1028
1072
|
},
|
1029
1073
|
|
1030
1074
|
stop: function() {
|
1031
|
-
$(this).removeData("resizable-alsoresize");
|
1075
|
+
$( this ).removeData( "ui-resizable-alsoresize" );
|
1032
1076
|
}
|
1033
|
-
});
|
1077
|
+
} );
|
1034
1078
|
|
1035
|
-
$.ui.plugin.add("resizable", "ghost", {
|
1079
|
+
$.ui.plugin.add( "resizable", "ghost", {
|
1036
1080
|
|
1037
1081
|
start: function() {
|
1038
1082
|
|
1039
|
-
var that = $(this).resizable( "instance" ),
|
1083
|
+
var that = $( this ).resizable( "instance" ), cs = that.size;
|
1040
1084
|
|
1041
1085
|
that.ghost = that.originalElement.clone();
|
1042
|
-
that.ghost
|
1043
|
-
.
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1086
|
+
that.ghost.css( {
|
1087
|
+
opacity: 0.25,
|
1088
|
+
display: "block",
|
1089
|
+
position: "relative",
|
1090
|
+
height: cs.height,
|
1091
|
+
width: cs.width,
|
1092
|
+
margin: 0,
|
1093
|
+
left: 0,
|
1094
|
+
top: 0
|
1095
|
+
} );
|
1096
|
+
|
1097
|
+
that._addClass( that.ghost, "ui-resizable-ghost" );
|
1098
|
+
|
1099
|
+
// DEPRECATED
|
1100
|
+
// TODO: remove after 1.12
|
1101
|
+
if ( $.uiBackCompat !== false && typeof that.options.ghost === "string" ) {
|
1102
|
+
|
1103
|
+
// Ghost option
|
1104
|
+
that.ghost.addClass( this.options.ghost );
|
1105
|
+
}
|
1055
1106
|
|
1056
|
-
that.ghost.appendTo(that.helper);
|
1107
|
+
that.ghost.appendTo( that.helper );
|
1057
1108
|
|
1058
1109
|
},
|
1059
1110
|
|
1060
1111
|
resize: function() {
|
1061
|
-
var that = $(this).resizable( "instance" );
|
1062
|
-
if (that.ghost) {
|
1063
|
-
that.ghost.css({
|
1112
|
+
var that = $( this ).resizable( "instance" );
|
1113
|
+
if ( that.ghost ) {
|
1114
|
+
that.ghost.css( {
|
1064
1115
|
position: "relative",
|
1065
1116
|
height: that.size.height,
|
1066
1117
|
width: that.size.width
|
1067
|
-
});
|
1118
|
+
} );
|
1068
1119
|
}
|
1069
1120
|
},
|
1070
1121
|
|
1071
1122
|
stop: function() {
|
1072
|
-
var that = $(this).resizable( "instance" );
|
1073
|
-
if (that.ghost && that.helper) {
|
1074
|
-
that.helper.get(0).removeChild(that.ghost.get(0));
|
1123
|
+
var that = $( this ).resizable( "instance" );
|
1124
|
+
if ( that.ghost && that.helper ) {
|
1125
|
+
that.helper.get( 0 ).removeChild( that.ghost.get( 0 ) );
|
1075
1126
|
}
|
1076
1127
|
}
|
1077
1128
|
|
1078
|
-
});
|
1129
|
+
} );
|
1079
1130
|
|
1080
|
-
$.ui.plugin.add("resizable", "grid", {
|
1131
|
+
$.ui.plugin.add( "resizable", "grid", {
|
1081
1132
|
|
1082
1133
|
resize: function() {
|
1083
1134
|
var outerDimensions,
|
1084
|
-
that = $(this).resizable( "instance" ),
|
1135
|
+
that = $( this ).resizable( "instance" ),
|
1085
1136
|
o = that.options,
|
1086
1137
|
cs = that.size,
|
1087
1138
|
os = that.originalSize,
|
1088
1139
|
op = that.originalPosition,
|
1089
1140
|
a = that.axis,
|
1090
1141
|
grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
|
1091
|
-
gridX = (grid[0] || 1),
|
1092
|
-
gridY = (grid[1] || 1),
|
1093
|
-
ox = Math.round((cs.width - os.width) / gridX) * gridX,
|
1094
|
-
oy = Math.round((cs.height - os.height) / gridY) * gridY,
|
1142
|
+
gridX = ( grid[ 0 ] || 1 ),
|
1143
|
+
gridY = ( grid[ 1 ] || 1 ),
|
1144
|
+
ox = Math.round( ( cs.width - os.width ) / gridX ) * gridX,
|
1145
|
+
oy = Math.round( ( cs.height - os.height ) / gridY ) * gridY,
|
1095
1146
|
newWidth = os.width + ox,
|
1096
1147
|
newHeight = os.height + oy,
|
1097
|
-
isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
|
1098
|
-
isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
|
1099
|
-
isMinWidth = o.minWidth && (o.minWidth > newWidth),
|
1100
|
-
isMinHeight = o.minHeight && (o.minHeight > newHeight);
|
1148
|
+
isMaxWidth = o.maxWidth && ( o.maxWidth < newWidth ),
|
1149
|
+
isMaxHeight = o.maxHeight && ( o.maxHeight < newHeight ),
|
1150
|
+
isMinWidth = o.minWidth && ( o.minWidth > newWidth ),
|
1151
|
+
isMinHeight = o.minHeight && ( o.minHeight > newHeight );
|
1101
1152
|
|
1102
1153
|
o.grid = grid;
|
1103
1154
|
|
1104
|
-
if (isMinWidth) {
|
1155
|
+
if ( isMinWidth ) {
|
1105
1156
|
newWidth += gridX;
|
1106
1157
|
}
|
1107
|
-
if (isMinHeight) {
|
1158
|
+
if ( isMinHeight ) {
|
1108
1159
|
newHeight += gridY;
|
1109
1160
|
}
|
1110
|
-
if (isMaxWidth) {
|
1161
|
+
if ( isMaxWidth ) {
|
1111
1162
|
newWidth -= gridX;
|
1112
1163
|
}
|
1113
|
-
if (isMaxHeight) {
|
1164
|
+
if ( isMaxHeight ) {
|
1114
1165
|
newHeight -= gridY;
|
1115
1166
|
}
|
1116
1167
|
|
1117
|
-
if (/^(se|s|e)$/.test(a)) {
|
1168
|
+
if ( /^(se|s|e)$/.test( a ) ) {
|
1118
1169
|
that.size.width = newWidth;
|
1119
1170
|
that.size.height = newHeight;
|
1120
|
-
} else if (/^(ne)$/.test(a)) {
|
1171
|
+
} else if ( /^(ne)$/.test( a ) ) {
|
1121
1172
|
that.size.width = newWidth;
|
1122
1173
|
that.size.height = newHeight;
|
1123
1174
|
that.position.top = op.top - oy;
|
1124
|
-
} else if (/^(sw)$/.test(a)) {
|
1175
|
+
} else if ( /^(sw)$/.test( a ) ) {
|
1125
1176
|
that.size.width = newWidth;
|
1126
1177
|
that.size.height = newHeight;
|
1127
1178
|
that.position.left = op.left - ox;
|
1128
1179
|
} else {
|
1129
|
-
if ( newHeight - gridY <= 0 || newWidth - gridX <= 0) {
|
1180
|
+
if ( newHeight - gridY <= 0 || newWidth - gridX <= 0 ) {
|
1130
1181
|
outerDimensions = that._getPaddingPlusBorderDimensions( this );
|
1131
1182
|
}
|
1132
1183
|
|
@@ -1149,8 +1200,8 @@ $.ui.plugin.add("resizable", "grid", {
|
|
1149
1200
|
}
|
1150
1201
|
}
|
1151
1202
|
|
1152
|
-
});
|
1203
|
+
} );
|
1153
1204
|
|
1154
1205
|
return $.ui.resizable;
|
1155
1206
|
|
1156
|
-
}));
|
1207
|
+
} ) );
|