jquery-ui-rails 5.0.5 → 6.0.1
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 +16 -0
- data/README.md +67 -50
- data/Rakefile +51 -27
- data/VERSIONS.md +2 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_444444_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_555555_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_777620_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_777777_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_cc0000_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
- data/app/assets/javascripts/jquery-ui/core.js +15 -304
- data/app/assets/javascripts/jquery-ui/data.js +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/javascripts/jquery-ui.js +52 -33
- data/app/assets/stylesheets/jquery-ui/accordion.css +1 -15
- data/app/assets/stylesheets/jquery-ui/all.css +1 -1
- data/app/assets/stylesheets/jquery-ui/autocomplete.css +1 -3
- data/app/assets/stylesheets/jquery-ui/base.css +3 -1
- data/app/assets/stylesheets/jquery-ui/button.css +35 -68
- data/app/assets/stylesheets/jquery-ui/checkboxradio.css +37 -0
- data/app/assets/stylesheets/jquery-ui/controlgroup.css +68 -0
- data/app/assets/stylesheets/jquery-ui/core.css +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
@@ -1,41 +1,65 @@
|
|
1
|
-
//= require jquery-ui/
|
2
|
-
//= require jquery-ui/
|
1
|
+
//= require jquery-ui/widgets/menu
|
2
|
+
//= require jquery-ui/escape-selector
|
3
|
+
//= require jquery-ui/form-reset-mixin
|
4
|
+
//= require jquery-ui/keycode
|
5
|
+
//= require jquery-ui/labels
|
3
6
|
//= require jquery-ui/position
|
4
|
-
//= require jquery-ui/
|
7
|
+
//= require jquery-ui/unique-id
|
8
|
+
//= require jquery-ui/version
|
9
|
+
//= require jquery-ui/widget
|
5
10
|
|
6
11
|
/*!
|
7
|
-
* jQuery UI Selectmenu 1.
|
12
|
+
* jQuery UI Selectmenu 1.12.1
|
8
13
|
* http://jqueryui.com
|
9
14
|
*
|
10
15
|
* Copyright jQuery Foundation and other contributors
|
11
16
|
* Released under the MIT license.
|
12
17
|
* http://jquery.org/license
|
13
|
-
*
|
14
|
-
* http://api.jqueryui.com/selectmenu
|
15
18
|
*/
|
16
|
-
|
19
|
+
|
20
|
+
//>>label: Selectmenu
|
21
|
+
//>>group: Widgets
|
22
|
+
// jscs:disable maximumLineLength
|
23
|
+
//>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select.
|
24
|
+
// jscs:enable maximumLineLength
|
25
|
+
//>>docs: http://api.jqueryui.com/selectmenu/
|
26
|
+
//>>demos: http://jqueryui.com/selectmenu/
|
27
|
+
//>>css.structure: ../../themes/base/core.css
|
28
|
+
//>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css
|
29
|
+
//>>css.theme: ../../themes/base/theme.css
|
30
|
+
|
31
|
+
( function( factory ) {
|
17
32
|
if ( typeof define === "function" && define.amd ) {
|
18
33
|
|
19
34
|
// AMD. Register as an anonymous module.
|
20
|
-
define([
|
35
|
+
define( [
|
21
36
|
"jquery",
|
22
|
-
"./
|
23
|
-
"
|
24
|
-
"
|
25
|
-
"
|
37
|
+
"./menu",
|
38
|
+
"../escape-selector",
|
39
|
+
"../form-reset-mixin",
|
40
|
+
"../keycode",
|
41
|
+
"../labels",
|
42
|
+
"../position",
|
43
|
+
"../unique-id",
|
44
|
+
"../version",
|
45
|
+
"../widget"
|
26
46
|
], factory );
|
27
47
|
} else {
|
28
48
|
|
29
49
|
// Browser globals
|
30
50
|
factory( jQuery );
|
31
51
|
}
|
32
|
-
}(function( $ ) {
|
52
|
+
}( function( $ ) {
|
33
53
|
|
34
|
-
return $.widget( "ui.selectmenu", {
|
35
|
-
version: "1.
|
54
|
+
return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, {
|
55
|
+
version: "1.12.1",
|
36
56
|
defaultElement: "<select>",
|
37
57
|
options: {
|
38
58
|
appendTo: null,
|
59
|
+
classes: {
|
60
|
+
"ui-selectmenu-button-open": "ui-corner-top",
|
61
|
+
"ui-selectmenu-button-closed": "ui-corner-all"
|
62
|
+
},
|
39
63
|
disabled: null,
|
40
64
|
icons: {
|
41
65
|
button: "ui-icon-triangle-1-s"
|
@@ -45,9 +69,9 @@ return $.widget( "ui.selectmenu", {
|
|
45
69
|
at: "left bottom",
|
46
70
|
collision: "none"
|
47
71
|
},
|
48
|
-
width:
|
72
|
+
width: false,
|
49
73
|
|
50
|
-
//
|
74
|
+
// Callbacks
|
51
75
|
change: null,
|
52
76
|
close: null,
|
53
77
|
focus: null,
|
@@ -65,64 +89,66 @@ return $.widget( "ui.selectmenu", {
|
|
65
89
|
|
66
90
|
this._drawButton();
|
67
91
|
this._drawMenu();
|
92
|
+
this._bindFormResetHandler();
|
68
93
|
|
69
|
-
|
70
|
-
|
71
|
-
}
|
94
|
+
this._rendered = false;
|
95
|
+
this.menuItems = $();
|
72
96
|
},
|
73
97
|
|
74
98
|
_drawButton: function() {
|
75
|
-
var
|
99
|
+
var icon,
|
100
|
+
that = this,
|
101
|
+
item = this._parseOption(
|
102
|
+
this.element.find( "option:selected" ),
|
103
|
+
this.element[ 0 ].selectedIndex
|
104
|
+
);
|
76
105
|
|
77
106
|
// Associate existing label with the new button
|
78
|
-
this.
|
79
|
-
this._on( this.
|
107
|
+
this.labels = this.element.labels().attr( "for", this.ids.button );
|
108
|
+
this._on( this.labels, {
|
80
109
|
click: function( event ) {
|
81
110
|
this.button.focus();
|
82
111
|
event.preventDefault();
|
83
112
|
}
|
84
|
-
});
|
113
|
+
} );
|
85
114
|
|
86
115
|
// Hide original select element
|
87
116
|
this.element.hide();
|
88
117
|
|
89
118
|
// Create button
|
90
119
|
this.button = $( "<span>", {
|
91
|
-
"class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all",
|
92
120
|
tabindex: this.options.disabled ? -1 : 0,
|
93
121
|
id: this.ids.button,
|
94
122
|
role: "combobox",
|
95
123
|
"aria-expanded": "false",
|
96
124
|
"aria-autocomplete": "list",
|
97
125
|
"aria-owns": this.ids.menu,
|
98
|
-
"aria-haspopup": "true"
|
99
|
-
|
126
|
+
"aria-haspopup": "true",
|
127
|
+
title: this.element.attr( "title" )
|
128
|
+
} )
|
100
129
|
.insertAfter( this.element );
|
101
130
|
|
102
|
-
|
103
|
-
"
|
104
|
-
})
|
105
|
-
.prependTo( this.button );
|
131
|
+
this._addClass( this.button, "ui-selectmenu-button ui-selectmenu-button-closed",
|
132
|
+
"ui-button ui-widget" );
|
106
133
|
|
107
|
-
|
108
|
-
|
109
|
-
|
134
|
+
icon = $( "<span>" ).appendTo( this.button );
|
135
|
+
this._addClass( icon, "ui-selectmenu-icon", "ui-icon " + this.options.icons.button );
|
136
|
+
this.buttonItem = this._renderButtonItem( item )
|
110
137
|
.appendTo( this.button );
|
111
138
|
|
112
|
-
|
113
|
-
|
139
|
+
if ( this.options.width !== false ) {
|
140
|
+
this._resizeButton();
|
141
|
+
}
|
114
142
|
|
115
143
|
this._on( this.button, this._buttonEvents );
|
116
144
|
this.button.one( "focusin", function() {
|
117
145
|
|
118
146
|
// Delay rendering the menu items until the button receives focus.
|
119
147
|
// The menu may have already been rendered via a programmatic open.
|
120
|
-
if ( !that.
|
148
|
+
if ( !that._rendered ) {
|
121
149
|
that._refreshMenu();
|
122
150
|
}
|
123
|
-
});
|
124
|
-
this._hoverable( this.button );
|
125
|
-
this._focusable( this.button );
|
151
|
+
} );
|
126
152
|
},
|
127
153
|
|
128
154
|
_drawMenu: function() {
|
@@ -133,23 +159,24 @@ return $.widget( "ui.selectmenu", {
|
|
133
159
|
"aria-hidden": "true",
|
134
160
|
"aria-labelledby": this.ids.button,
|
135
161
|
id: this.ids.menu
|
136
|
-
});
|
162
|
+
} );
|
137
163
|
|
138
164
|
// Wrap menu
|
139
|
-
this.menuWrap = $( "<div>"
|
140
|
-
|
141
|
-
|
142
|
-
.append( this.menu )
|
143
|
-
.appendTo( this._appendTo() );
|
165
|
+
this.menuWrap = $( "<div>" ).append( this.menu );
|
166
|
+
this._addClass( this.menuWrap, "ui-selectmenu-menu", "ui-front" );
|
167
|
+
this.menuWrap.appendTo( this._appendTo() );
|
144
168
|
|
145
169
|
// Initialize menu widget
|
146
170
|
this.menuInstance = this.menu
|
147
|
-
.menu({
|
171
|
+
.menu( {
|
172
|
+
classes: {
|
173
|
+
"ui-menu": "ui-corner-bottom"
|
174
|
+
},
|
148
175
|
role: "listbox",
|
149
176
|
select: function( event, ui ) {
|
150
177
|
event.preventDefault();
|
151
178
|
|
152
|
-
//
|
179
|
+
// Support: IE8
|
153
180
|
// If the item was selected via a click, the text selection
|
154
181
|
// will be destroyed in IE
|
155
182
|
that._setSelection();
|
@@ -171,14 +198,9 @@ return $.widget( "ui.selectmenu", {
|
|
171
198
|
that.button.attr( "aria-activedescendant",
|
172
199
|
that.menuItems.eq( item.index ).attr( "id" ) );
|
173
200
|
}
|
174
|
-
})
|
201
|
+
} )
|
175
202
|
.menu( "instance" );
|
176
203
|
|
177
|
-
// Adjust menu styles to dropdown
|
178
|
-
this.menu
|
179
|
-
.addClass( "ui-corner-bottom" )
|
180
|
-
.removeClass( "ui-corner-all" );
|
181
|
-
|
182
204
|
// Don't close the menu on mouseleave
|
183
205
|
this.menuInstance._off( this.menu, "mouseleave" );
|
184
206
|
|
@@ -195,27 +217,37 @@ return $.widget( "ui.selectmenu", {
|
|
195
217
|
|
196
218
|
refresh: function() {
|
197
219
|
this._refreshMenu();
|
198
|
-
this.
|
199
|
-
|
220
|
+
this.buttonItem.replaceWith(
|
221
|
+
this.buttonItem = this._renderButtonItem(
|
222
|
+
|
223
|
+
// Fall back to an empty object in case there are no options
|
224
|
+
this._getSelectedItem().data( "ui-selectmenu-item" ) || {}
|
225
|
+
)
|
226
|
+
);
|
227
|
+
if ( this.options.width === null ) {
|
200
228
|
this._resizeButton();
|
201
229
|
}
|
202
230
|
},
|
203
231
|
|
204
232
|
_refreshMenu: function() {
|
205
|
-
this.menu.empty();
|
206
|
-
|
207
233
|
var item,
|
208
234
|
options = this.element.find( "option" );
|
209
235
|
|
210
|
-
|
211
|
-
return;
|
212
|
-
}
|
236
|
+
this.menu.empty();
|
213
237
|
|
214
238
|
this._parseOptions( options );
|
215
239
|
this._renderMenu( this.menu, this.items );
|
216
240
|
|
217
241
|
this.menuInstance.refresh();
|
218
|
-
this.menuItems = this.menu.find( "li" )
|
242
|
+
this.menuItems = this.menu.find( "li" )
|
243
|
+
.not( ".ui-selectmenu-optgroup" )
|
244
|
+
.find( ".ui-menu-item-wrapper" );
|
245
|
+
|
246
|
+
this._rendered = true;
|
247
|
+
|
248
|
+
if ( !options.length ) {
|
249
|
+
return;
|
250
|
+
}
|
219
251
|
|
220
252
|
item = this._getSelectedItem();
|
221
253
|
|
@@ -233,15 +265,20 @@ return $.widget( "ui.selectmenu", {
|
|
233
265
|
}
|
234
266
|
|
235
267
|
// If this is the first time the menu is being opened, render the items
|
236
|
-
if ( !this.
|
268
|
+
if ( !this._rendered ) {
|
237
269
|
this._refreshMenu();
|
238
270
|
} else {
|
239
271
|
|
240
272
|
// Menu clears focus on close, reset focus to selected item
|
241
|
-
this.menu.find( ".ui-state-
|
273
|
+
this._removeClass( this.menu.find( ".ui-state-active" ), null, "ui-state-active" );
|
242
274
|
this.menuInstance.focus( null, this._getSelectedItem() );
|
243
275
|
}
|
244
276
|
|
277
|
+
// If there are no options, don't open the menu
|
278
|
+
if ( !this.menuItems.length ) {
|
279
|
+
return;
|
280
|
+
}
|
281
|
+
|
245
282
|
this.isOpen = true;
|
246
283
|
this._toggleAttr();
|
247
284
|
this._resizeMenu();
|
@@ -278,26 +315,38 @@ return $.widget( "ui.selectmenu", {
|
|
278
315
|
return this.menu;
|
279
316
|
},
|
280
317
|
|
318
|
+
_renderButtonItem: function( item ) {
|
319
|
+
var buttonItem = $( "<span>" );
|
320
|
+
|
321
|
+
this._setText( buttonItem, item.label );
|
322
|
+
this._addClass( buttonItem, "ui-selectmenu-text" );
|
323
|
+
|
324
|
+
return buttonItem;
|
325
|
+
},
|
326
|
+
|
281
327
|
_renderMenu: function( ul, items ) {
|
282
328
|
var that = this,
|
283
329
|
currentOptgroup = "";
|
284
330
|
|
285
331
|
$.each( items, function( index, item ) {
|
332
|
+
var li;
|
333
|
+
|
286
334
|
if ( item.optgroup !== currentOptgroup ) {
|
287
|
-
$( "<li>", {
|
288
|
-
"class": "ui-selectmenu-optgroup ui-menu-divider" +
|
289
|
-
( item.element.parent( "optgroup" ).prop( "disabled" ) ?
|
290
|
-
" ui-state-disabled" :
|
291
|
-
"" ),
|
335
|
+
li = $( "<li>", {
|
292
336
|
text: item.optgroup
|
293
|
-
})
|
294
|
-
|
337
|
+
} );
|
338
|
+
that._addClass( li, "ui-selectmenu-optgroup", "ui-menu-divider" +
|
339
|
+
( item.element.parent( "optgroup" ).prop( "disabled" ) ?
|
340
|
+
" ui-state-disabled" :
|
341
|
+
"" ) );
|
342
|
+
|
343
|
+
li.appendTo( ul );
|
295
344
|
|
296
345
|
currentOptgroup = item.optgroup;
|
297
346
|
}
|
298
347
|
|
299
348
|
that._renderItemData( ul, item );
|
300
|
-
});
|
349
|
+
} );
|
301
350
|
},
|
302
351
|
|
303
352
|
_renderItemData: function( ul, item ) {
|
@@ -305,14 +354,17 @@ return $.widget( "ui.selectmenu", {
|
|
305
354
|
},
|
306
355
|
|
307
356
|
_renderItem: function( ul, item ) {
|
308
|
-
var li = $( "<li>" )
|
357
|
+
var li = $( "<li>" ),
|
358
|
+
wrapper = $( "<div>", {
|
359
|
+
title: item.element.attr( "title" )
|
360
|
+
} );
|
309
361
|
|
310
362
|
if ( item.disabled ) {
|
311
|
-
|
363
|
+
this._addClass( li, null, "ui-state-disabled" );
|
312
364
|
}
|
313
|
-
this._setText(
|
365
|
+
this._setText( wrapper, item.label );
|
314
366
|
|
315
|
-
return li.appendTo( ul );
|
367
|
+
return li.append( wrapper ).appendTo( ul );
|
316
368
|
},
|
317
369
|
|
318
370
|
_setText: function( element, value ) {
|
@@ -328,9 +380,9 @@ return $.widget( "ui.selectmenu", {
|
|
328
380
|
filter = ".ui-menu-item";
|
329
381
|
|
330
382
|
if ( this.isOpen ) {
|
331
|
-
item = this.menuItems.eq( this.focusIndex );
|
383
|
+
item = this.menuItems.eq( this.focusIndex ).parent( "li" );
|
332
384
|
} else {
|
333
|
-
item = this.menuItems.eq( this.element[ 0 ].selectedIndex );
|
385
|
+
item = this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
|
334
386
|
filter += ":not(.ui-state-disabled)";
|
335
387
|
}
|
336
388
|
|
@@ -346,7 +398,7 @@ return $.widget( "ui.selectmenu", {
|
|
346
398
|
},
|
347
399
|
|
348
400
|
_getSelectedItem: function() {
|
349
|
-
return this.menuItems.eq( this.element[ 0 ].selectedIndex );
|
401
|
+
return this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
|
350
402
|
},
|
351
403
|
|
352
404
|
_toggle: function( event ) {
|
@@ -365,12 +417,12 @@ return $.widget( "ui.selectmenu", {
|
|
365
417
|
selection.removeAllRanges();
|
366
418
|
selection.addRange( this.range );
|
367
419
|
|
368
|
-
//
|
420
|
+
// Support: IE8
|
369
421
|
} else {
|
370
422
|
this.range.select();
|
371
423
|
}
|
372
424
|
|
373
|
-
//
|
425
|
+
// Support: IE
|
374
426
|
// Setting the text selection kills the button focus in IE, but
|
375
427
|
// restoring the focus doesn't kill the selection.
|
376
428
|
this.button.focus();
|
@@ -382,7 +434,8 @@ return $.widget( "ui.selectmenu", {
|
|
382
434
|
return;
|
383
435
|
}
|
384
436
|
|
385
|
-
if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" +
|
437
|
+
if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" +
|
438
|
+
$.ui.escapeSelector( this.ids.button ) ).length ) {
|
386
439
|
this.close( event );
|
387
440
|
}
|
388
441
|
}
|
@@ -400,7 +453,7 @@ return $.widget( "ui.selectmenu", {
|
|
400
453
|
this.range = selection.getRangeAt( 0 );
|
401
454
|
}
|
402
455
|
|
403
|
-
//
|
456
|
+
// Support: IE8
|
404
457
|
} else {
|
405
458
|
this.range = document.selection.createRange();
|
406
459
|
}
|
@@ -414,54 +467,54 @@ return $.widget( "ui.selectmenu", {
|
|
414
467
|
keydown: function( event ) {
|
415
468
|
var preventDefault = true;
|
416
469
|
switch ( event.keyCode ) {
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
this._move( "prev", event );
|
432
|
-
}
|
433
|
-
break;
|
434
|
-
case $.ui.keyCode.DOWN:
|
435
|
-
if ( event.altKey ) {
|
436
|
-
this._toggle( event );
|
437
|
-
} else {
|
438
|
-
this._move( "next", event );
|
439
|
-
}
|
440
|
-
break;
|
441
|
-
case $.ui.keyCode.SPACE:
|
442
|
-
if ( this.isOpen ) {
|
443
|
-
this._selectFocusedItem( event );
|
444
|
-
} else {
|
445
|
-
this._toggle( event );
|
446
|
-
}
|
447
|
-
break;
|
448
|
-
case $.ui.keyCode.LEFT:
|
470
|
+
case $.ui.keyCode.TAB:
|
471
|
+
case $.ui.keyCode.ESCAPE:
|
472
|
+
this.close( event );
|
473
|
+
preventDefault = false;
|
474
|
+
break;
|
475
|
+
case $.ui.keyCode.ENTER:
|
476
|
+
if ( this.isOpen ) {
|
477
|
+
this._selectFocusedItem( event );
|
478
|
+
}
|
479
|
+
break;
|
480
|
+
case $.ui.keyCode.UP:
|
481
|
+
if ( event.altKey ) {
|
482
|
+
this._toggle( event );
|
483
|
+
} else {
|
449
484
|
this._move( "prev", event );
|
450
|
-
|
451
|
-
|
485
|
+
}
|
486
|
+
break;
|
487
|
+
case $.ui.keyCode.DOWN:
|
488
|
+
if ( event.altKey ) {
|
489
|
+
this._toggle( event );
|
490
|
+
} else {
|
452
491
|
this._move( "next", event );
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
492
|
+
}
|
493
|
+
break;
|
494
|
+
case $.ui.keyCode.SPACE:
|
495
|
+
if ( this.isOpen ) {
|
496
|
+
this._selectFocusedItem( event );
|
497
|
+
} else {
|
498
|
+
this._toggle( event );
|
499
|
+
}
|
500
|
+
break;
|
501
|
+
case $.ui.keyCode.LEFT:
|
502
|
+
this._move( "prev", event );
|
503
|
+
break;
|
504
|
+
case $.ui.keyCode.RIGHT:
|
505
|
+
this._move( "next", event );
|
506
|
+
break;
|
507
|
+
case $.ui.keyCode.HOME:
|
508
|
+
case $.ui.keyCode.PAGE_UP:
|
509
|
+
this._move( "first", event );
|
510
|
+
break;
|
511
|
+
case $.ui.keyCode.END:
|
512
|
+
case $.ui.keyCode.PAGE_DOWN:
|
513
|
+
this._move( "last", event );
|
514
|
+
break;
|
515
|
+
default:
|
516
|
+
this.menu.trigger( event );
|
517
|
+
preventDefault = false;
|
465
518
|
}
|
466
519
|
|
467
520
|
if ( preventDefault ) {
|
@@ -471,7 +524,7 @@ return $.widget( "ui.selectmenu", {
|
|
471
524
|
},
|
472
525
|
|
473
526
|
_selectFocusedItem: function( event ) {
|
474
|
-
var item = this.menuItems.eq( this.focusIndex );
|
527
|
+
var item = this.menuItems.eq( this.focusIndex ).parent( "li" );
|
475
528
|
if ( !item.hasClass( "ui-state-disabled" ) ) {
|
476
529
|
this._select( item.data( "ui-selectmenu-item" ), event );
|
477
530
|
}
|
@@ -482,7 +535,7 @@ return $.widget( "ui.selectmenu", {
|
|
482
535
|
|
483
536
|
// Change native select element
|
484
537
|
this.element[ 0 ].selectedIndex = item.index;
|
485
|
-
this.
|
538
|
+
this.buttonItem.replaceWith( this.buttonItem = this._renderButtonItem( item ) );
|
486
539
|
this._setAria( item );
|
487
540
|
this._trigger( "select", event, { item: item } );
|
488
541
|
|
@@ -496,18 +549,18 @@ return $.widget( "ui.selectmenu", {
|
|
496
549
|
_setAria: function( item ) {
|
497
550
|
var id = this.menuItems.eq( item.index ).attr( "id" );
|
498
551
|
|
499
|
-
this.button.attr({
|
552
|
+
this.button.attr( {
|
500
553
|
"aria-labelledby": id,
|
501
554
|
"aria-activedescendant": id
|
502
|
-
});
|
555
|
+
} );
|
503
556
|
this.menu.attr( "aria-activedescendant", id );
|
504
557
|
},
|
505
558
|
|
506
559
|
_setOption: function( key, value ) {
|
507
560
|
if ( key === "icons" ) {
|
508
|
-
this.button.find( "span.ui-icon" )
|
509
|
-
|
510
|
-
.
|
561
|
+
var icon = this.button.find( "span.ui-icon" );
|
562
|
+
this._removeClass( icon, null, this.options.icons.button )
|
563
|
+
._addClass( icon, null, value.button );
|
511
564
|
}
|
512
565
|
|
513
566
|
this._super( key, value );
|
@@ -516,26 +569,27 @@ return $.widget( "ui.selectmenu", {
|
|
516
569
|
this.menuWrap.appendTo( this._appendTo() );
|
517
570
|
}
|
518
571
|
|
519
|
-
if ( key === "disabled" ) {
|
520
|
-
this.menuInstance.option( "disabled", value );
|
521
|
-
this.button
|
522
|
-
.toggleClass( "ui-state-disabled", value )
|
523
|
-
.attr( "aria-disabled", value );
|
524
|
-
|
525
|
-
this.element.prop( "disabled", value );
|
526
|
-
if ( value ) {
|
527
|
-
this.button.attr( "tabindex", -1 );
|
528
|
-
this.close();
|
529
|
-
} else {
|
530
|
-
this.button.attr( "tabindex", 0 );
|
531
|
-
}
|
532
|
-
}
|
533
|
-
|
534
572
|
if ( key === "width" ) {
|
535
573
|
this._resizeButton();
|
536
574
|
}
|
537
575
|
},
|
538
576
|
|
577
|
+
_setOptionDisabled: function( value ) {
|
578
|
+
this._super( value );
|
579
|
+
|
580
|
+
this.menuInstance.option( "disabled", value );
|
581
|
+
this.button.attr( "aria-disabled", value );
|
582
|
+
this._toggleClass( this.button, null, "ui-state-disabled", value );
|
583
|
+
|
584
|
+
this.element.prop( "disabled", value );
|
585
|
+
if ( value ) {
|
586
|
+
this.button.attr( "tabindex", -1 );
|
587
|
+
this.close();
|
588
|
+
} else {
|
589
|
+
this.button.attr( "tabindex", 0 );
|
590
|
+
}
|
591
|
+
},
|
592
|
+
|
539
593
|
_appendTo: function() {
|
540
594
|
var element = this.options.appendTo;
|
541
595
|
|
@@ -546,7 +600,7 @@ return $.widget( "ui.selectmenu", {
|
|
546
600
|
}
|
547
601
|
|
548
602
|
if ( !element || !element[ 0 ] ) {
|
549
|
-
element = this.element.closest( ".ui-front" );
|
603
|
+
element = this.element.closest( ".ui-front, dialog" );
|
550
604
|
}
|
551
605
|
|
552
606
|
if ( !element.length ) {
|
@@ -557,18 +611,31 @@ return $.widget( "ui.selectmenu", {
|
|
557
611
|
},
|
558
612
|
|
559
613
|
_toggleAttr: function() {
|
560
|
-
this.button
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
614
|
+
this.button.attr( "aria-expanded", this.isOpen );
|
615
|
+
|
616
|
+
// We can't use two _toggleClass() calls here, because we need to make sure
|
617
|
+
// we always remove classes first and add them second, otherwise if both classes have the
|
618
|
+
// same theme class, it will be removed after we add it.
|
619
|
+
this._removeClass( this.button, "ui-selectmenu-button-" +
|
620
|
+
( this.isOpen ? "closed" : "open" ) )
|
621
|
+
._addClass( this.button, "ui-selectmenu-button-" +
|
622
|
+
( this.isOpen ? "open" : "closed" ) )
|
623
|
+
._toggleClass( this.menuWrap, "ui-selectmenu-open", null, this.isOpen );
|
624
|
+
|
565
625
|
this.menu.attr( "aria-hidden", !this.isOpen );
|
566
626
|
},
|
567
627
|
|
568
628
|
_resizeButton: function() {
|
569
629
|
var width = this.options.width;
|
570
630
|
|
571
|
-
|
631
|
+
// For `width: false`, just remove inline style and stop
|
632
|
+
if ( width === false ) {
|
633
|
+
this.button.css( "width", "" );
|
634
|
+
return;
|
635
|
+
}
|
636
|
+
|
637
|
+
// For `width: null`, match the width of the original element
|
638
|
+
if ( width === null ) {
|
572
639
|
width = this.element.show().outerWidth();
|
573
640
|
this.element.hide();
|
574
641
|
}
|
@@ -580,7 +647,7 @@ return $.widget( "ui.selectmenu", {
|
|
580
647
|
this.menu.outerWidth( Math.max(
|
581
648
|
this.button.outerWidth(),
|
582
649
|
|
583
|
-
//
|
650
|
+
// Support: IE10
|
584
651
|
// IE10 wraps long text (possibly a rounding bug)
|
585
652
|
// so we add 1px to avoid the wrapping
|
586
653
|
this.menu.width( "" ).outerWidth() + 1
|
@@ -588,33 +655,43 @@ return $.widget( "ui.selectmenu", {
|
|
588
655
|
},
|
589
656
|
|
590
657
|
_getCreateOptions: function() {
|
591
|
-
|
658
|
+
var options = this._super();
|
659
|
+
|
660
|
+
options.disabled = this.element.prop( "disabled" );
|
661
|
+
|
662
|
+
return options;
|
592
663
|
},
|
593
664
|
|
594
665
|
_parseOptions: function( options ) {
|
595
|
-
var
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
element: option,
|
601
|
-
index: index,
|
602
|
-
value: option.val(),
|
603
|
-
label: option.text(),
|
604
|
-
optgroup: optgroup.attr( "label" ) || "",
|
605
|
-
disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
|
606
|
-
});
|
607
|
-
});
|
666
|
+
var that = this,
|
667
|
+
data = [];
|
668
|
+
options.each( function( index, item ) {
|
669
|
+
data.push( that._parseOption( $( item ), index ) );
|
670
|
+
} );
|
608
671
|
this.items = data;
|
609
672
|
},
|
610
673
|
|
674
|
+
_parseOption: function( option, index ) {
|
675
|
+
var optgroup = option.parent( "optgroup" );
|
676
|
+
|
677
|
+
return {
|
678
|
+
element: option,
|
679
|
+
index: index,
|
680
|
+
value: option.val(),
|
681
|
+
label: option.text(),
|
682
|
+
optgroup: optgroup.attr( "label" ) || "",
|
683
|
+
disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
|
684
|
+
};
|
685
|
+
},
|
686
|
+
|
611
687
|
_destroy: function() {
|
688
|
+
this._unbindFormResetHandler();
|
612
689
|
this.menuWrap.remove();
|
613
690
|
this.button.remove();
|
614
691
|
this.element.show();
|
615
692
|
this.element.removeUniqueId();
|
616
|
-
this.
|
693
|
+
this.labels.attr( "for", this.ids.element );
|
617
694
|
}
|
618
|
-
});
|
695
|
+
} ] );
|
619
696
|
|
620
|
-
}));
|
697
|
+
} ) );
|