sn-jquery-ui-rails 6.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.gitmodules +3 -0
  4. data/.travis.yml +2 -0
  5. data/Gemfile +3 -0
  6. data/History.md +168 -0
  7. data/License.txt +2 -0
  8. data/README.md +311 -0
  9. data/Rakefile +258 -0
  10. data/VERSIONS.md +39 -0
  11. data/app/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  12. data/app/assets/images/jquery-ui/ui-icons_444444_256x240.png +0 -0
  13. data/app/assets/images/jquery-ui/ui-icons_555555_256x240.png +0 -0
  14. data/app/assets/images/jquery-ui/ui-icons_777620_256x240.png +0 -0
  15. data/app/assets/images/jquery-ui/ui-icons_777777_256x240.png +0 -0
  16. data/app/assets/images/jquery-ui/ui-icons_cc0000_256x240.png +0 -0
  17. data/app/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
  18. data/app/assets/javascripts/jquery-ui/core.js +15 -0
  19. data/app/assets/javascripts/jquery-ui/data.js +41 -0
  20. data/app/assets/javascripts/jquery-ui/disable-selection.js +48 -0
  21. data/app/assets/javascripts/jquery-ui/effect.all.js +15 -0
  22. data/app/assets/javascripts/jquery-ui/effect.js +1637 -0
  23. data/app/assets/javascripts/jquery-ui/effects/effect-blind.js +73 -0
  24. data/app/assets/javascripts/jquery-ui/effects/effect-bounce.js +113 -0
  25. data/app/assets/javascripts/jquery-ui/effects/effect-clip.js +68 -0
  26. data/app/assets/javascripts/jquery-ui/effects/effect-drop.js +72 -0
  27. data/app/assets/javascripts/jquery-ui/effects/effect-explode.js +114 -0
  28. data/app/assets/javascripts/jquery-ui/effects/effect-fade.js +50 -0
  29. data/app/assets/javascripts/jquery-ui/effects/effect-fold.js +92 -0
  30. data/app/assets/javascripts/jquery-ui/effects/effect-highlight.js +60 -0
  31. data/app/assets/javascripts/jquery-ui/effects/effect-puff.js +46 -0
  32. data/app/assets/javascripts/jquery-ui/effects/effect-pulsate.js +67 -0
  33. data/app/assets/javascripts/jquery-ui/effects/effect-scale.js +60 -0
  34. data/app/assets/javascripts/jquery-ui/effects/effect-shake.js +77 -0
  35. data/app/assets/javascripts/jquery-ui/effects/effect-size.js +194 -0
  36. data/app/assets/javascripts/jquery-ui/effects/effect-slide.js +79 -0
  37. data/app/assets/javascripts/jquery-ui/effects/effect-transfer.js +43 -0
  38. data/app/assets/javascripts/jquery-ui/escape-selector.js +23 -0
  39. data/app/assets/javascripts/jquery-ui/focusable.js +86 -0
  40. data/app/assets/javascripts/jquery-ui/form-reset-mixin.js +80 -0
  41. data/app/assets/javascripts/jquery-ui/form.js +22 -0
  42. data/app/assets/javascripts/jquery-ui/i18n/datepicker-af.js +37 -0
  43. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ar-DZ.js +39 -0
  44. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ar.js +39 -0
  45. data/app/assets/javascripts/jquery-ui/i18n/datepicker-az.js +37 -0
  46. data/app/assets/javascripts/jquery-ui/i18n/datepicker-be.js +37 -0
  47. data/app/assets/javascripts/jquery-ui/i18n/datepicker-bg.js +38 -0
  48. data/app/assets/javascripts/jquery-ui/i18n/datepicker-bs.js +37 -0
  49. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ca.js +37 -0
  50. data/app/assets/javascripts/jquery-ui/i18n/datepicker-cs.js +37 -0
  51. data/app/assets/javascripts/jquery-ui/i18n/datepicker-cy-GB.js +45 -0
  52. data/app/assets/javascripts/jquery-ui/i18n/datepicker-da.js +37 -0
  53. data/app/assets/javascripts/jquery-ui/i18n/datepicker-de.js +37 -0
  54. data/app/assets/javascripts/jquery-ui/i18n/datepicker-el.js +37 -0
  55. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-AU.js +37 -0
  56. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-GB.js +37 -0
  57. data/app/assets/javascripts/jquery-ui/i18n/datepicker-en-NZ.js +37 -0
  58. data/app/assets/javascripts/jquery-ui/i18n/datepicker-eo.js +37 -0
  59. data/app/assets/javascripts/jquery-ui/i18n/datepicker-es.js +37 -0
  60. data/app/assets/javascripts/jquery-ui/i18n/datepicker-et.js +45 -0
  61. data/app/assets/javascripts/jquery-ui/i18n/datepicker-eu.js +36 -0
  62. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fa.js +73 -0
  63. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fi.js +37 -0
  64. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fo.js +45 -0
  65. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr-CA.js +37 -0
  66. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr-CH.js +37 -0
  67. data/app/assets/javascripts/jquery-ui/i18n/datepicker-fr.js +39 -0
  68. data/app/assets/javascripts/jquery-ui/i18n/datepicker-gl.js +37 -0
  69. data/app/assets/javascripts/jquery-ui/i18n/datepicker-he.js +37 -0
  70. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hi.js +37 -0
  71. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hr.js +37 -0
  72. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hu.js +36 -0
  73. data/app/assets/javascripts/jquery-ui/i18n/datepicker-hy.js +37 -0
  74. data/app/assets/javascripts/jquery-ui/i18n/datepicker-id.js +37 -0
  75. data/app/assets/javascripts/jquery-ui/i18n/datepicker-is.js +45 -0
  76. data/app/assets/javascripts/jquery-ui/i18n/datepicker-it-CH.js +37 -0
  77. data/app/assets/javascripts/jquery-ui/i18n/datepicker-it.js +37 -0
  78. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ja.js +37 -0
  79. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ka.js +48 -0
  80. data/app/assets/javascripts/jquery-ui/i18n/datepicker-kk.js +37 -0
  81. data/app/assets/javascripts/jquery-ui/i18n/datepicker-km.js +37 -0
  82. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ko.js +37 -0
  83. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ky.js +38 -0
  84. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lb.js +45 -0
  85. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lt.js +45 -0
  86. data/app/assets/javascripts/jquery-ui/i18n/datepicker-lv.js +45 -0
  87. data/app/assets/javascripts/jquery-ui/i18n/datepicker-mk.js +37 -0
  88. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ml.js +37 -0
  89. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ms.js +37 -0
  90. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nb.js +49 -0
  91. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nl-BE.js +37 -0
  92. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nl.js +37 -0
  93. data/app/assets/javascripts/jquery-ui/i18n/datepicker-nn.js +49 -0
  94. data/app/assets/javascripts/jquery-ui/i18n/datepicker-no.js +50 -0
  95. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pl.js +37 -0
  96. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pt-BR.js +45 -0
  97. data/app/assets/javascripts/jquery-ui/i18n/datepicker-pt.js +44 -0
  98. data/app/assets/javascripts/jquery-ui/i18n/datepicker-rm.js +61 -0
  99. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ro.js +40 -0
  100. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ru.js +37 -0
  101. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sk.js +37 -0
  102. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sl.js +38 -0
  103. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sq.js +37 -0
  104. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sr-SR.js +37 -0
  105. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sr.js +37 -0
  106. data/app/assets/javascripts/jquery-ui/i18n/datepicker-sv.js +37 -0
  107. data/app/assets/javascripts/jquery-ui/i18n/datepicker-ta.js +53 -0
  108. data/app/assets/javascripts/jquery-ui/i18n/datepicker-th.js +37 -0
  109. data/app/assets/javascripts/jquery-ui/i18n/datepicker-tj.js +37 -0
  110. data/app/assets/javascripts/jquery-ui/i18n/datepicker-tr.js +37 -0
  111. data/app/assets/javascripts/jquery-ui/i18n/datepicker-uk.js +38 -0
  112. data/app/assets/javascripts/jquery-ui/i18n/datepicker-vi.js +37 -0
  113. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-CN.js +37 -0
  114. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-HK.js +37 -0
  115. data/app/assets/javascripts/jquery-ui/i18n/datepicker-zh-TW.js +37 -0
  116. data/app/assets/javascripts/jquery-ui/ie.js +17 -0
  117. data/app/assets/javascripts/jquery-ui/jquery-1-7.js +91 -0
  118. data/app/assets/javascripts/jquery-ui/keycode.js +47 -0
  119. data/app/assets/javascripts/jquery-ui/labels.js +65 -0
  120. data/app/assets/javascripts/jquery-ui/plugin.js +46 -0
  121. data/app/assets/javascripts/jquery-ui/position.js +500 -0
  122. data/app/assets/javascripts/jquery-ui/safe-active-element.js +42 -0
  123. data/app/assets/javascripts/jquery-ui/safe-blur.js +23 -0
  124. data/app/assets/javascripts/jquery-ui/scroll-parent.js +47 -0
  125. data/app/assets/javascripts/jquery-ui/tabbable.js +38 -0
  126. data/app/assets/javascripts/jquery-ui/unique-id.js +51 -0
  127. data/app/assets/javascripts/jquery-ui/version.js +17 -0
  128. data/app/assets/javascripts/jquery-ui/widget.js +735 -0
  129. data/app/assets/javascripts/jquery-ui/widgets/accordion.js +618 -0
  130. data/app/assets/javascripts/jquery-ui/widgets/autocomplete.js +689 -0
  131. data/app/assets/javascripts/jquery-ui/widgets/button.js +391 -0
  132. data/app/assets/javascripts/jquery-ui/widgets/checkboxradio.js +291 -0
  133. data/app/assets/javascripts/jquery-ui/widgets/controlgroup.js +300 -0
  134. data/app/assets/javascripts/jquery-ui/widgets/datepicker.js +2123 -0
  135. data/app/assets/javascripts/jquery-ui/widgets/dialog.js +954 -0
  136. data/app/assets/javascripts/jquery-ui/widgets/draggable.js +1259 -0
  137. data/app/assets/javascripts/jquery-ui/widgets/droppable.js +502 -0
  138. data/app/assets/javascripts/jquery-ui/widgets/menu.js +680 -0
  139. data/app/assets/javascripts/jquery-ui/widgets/mouse.js +230 -0
  140. data/app/assets/javascripts/jquery-ui/widgets/progressbar.js +181 -0
  141. data/app/assets/javascripts/jquery-ui/widgets/resizable.js +1207 -0
  142. data/app/assets/javascripts/jquery-ui/widgets/selectable.js +314 -0
  143. data/app/assets/javascripts/jquery-ui/widgets/selectmenu.js +697 -0
  144. data/app/assets/javascripts/jquery-ui/widgets/slider.js +757 -0
  145. data/app/assets/javascripts/jquery-ui/widgets/sortable.js +1561 -0
  146. data/app/assets/javascripts/jquery-ui/widgets/spinner.js +581 -0
  147. data/app/assets/javascripts/jquery-ui/widgets/tabs.js +931 -0
  148. data/app/assets/javascripts/jquery-ui/widgets/tooltip.js +526 -0
  149. data/app/assets/javascripts/jquery-ui.js +56 -0
  150. data/app/assets/stylesheets/jquery-ui/accordion.css +26 -0
  151. data/app/assets/stylesheets/jquery-ui/all.css +14 -0
  152. data/app/assets/stylesheets/jquery-ui/autocomplete.css +19 -0
  153. data/app/assets/stylesheets/jquery-ui/base.css +32 -0
  154. data/app/assets/stylesheets/jquery-ui/button.css +85 -0
  155. data/app/assets/stylesheets/jquery-ui/checkboxradio.css +37 -0
  156. data/app/assets/stylesheets/jquery-ui/controlgroup.css +68 -0
  157. data/app/assets/stylesheets/jquery-ui/core.css +100 -0
  158. data/app/assets/stylesheets/jquery-ui/datepicker.css +188 -0
  159. data/app/assets/stylesheets/jquery-ui/dialog.css +104 -0
  160. data/app/assets/stylesheets/jquery-ui/draggable.css +15 -0
  161. data/app/assets/stylesheets/jquery-ui/menu.css +67 -0
  162. data/app/assets/stylesheets/jquery-ui/progressbar.css +31 -0
  163. data/app/assets/stylesheets/jquery-ui/resizable.css +81 -0
  164. data/app/assets/stylesheets/jquery-ui/selectable.css +20 -0
  165. data/app/assets/stylesheets/jquery-ui/selectmenu.css +53 -0
  166. data/app/assets/stylesheets/jquery-ui/slider.css +78 -0
  167. data/app/assets/stylesheets/jquery-ui/sortable.css +15 -0
  168. data/app/assets/stylesheets/jquery-ui/spinner.css +55 -0
  169. data/app/assets/stylesheets/jquery-ui/tabs.css +54 -0
  170. data/app/assets/stylesheets/jquery-ui/theme.css.erb +453 -0
  171. data/app/assets/stylesheets/jquery-ui/tooltip.css +22 -0
  172. data/app/assets/stylesheets/jquery-ui.css +1 -0
  173. data/lib/jquery/ui/rails/engine.rb +8 -0
  174. data/lib/jquery/ui/rails/version.rb +8 -0
  175. data/lib/jquery/ui/rails.rb +2 -0
  176. data/lib/jquery-ui-rails.rb +1 -0
  177. metadata +248 -0
@@ -0,0 +1,300 @@
1
+ //= require jquery-ui/widget
2
+
3
+ /*!
4
+ * jQuery UI Controlgroup 1.12.1
5
+ * http://jqueryui.com
6
+ *
7
+ * Copyright jQuery Foundation and other contributors
8
+ * Released under the MIT license.
9
+ * http://jquery.org/license
10
+ */
11
+
12
+ //>>label: Controlgroup
13
+ //>>group: Widgets
14
+ //>>description: Visually groups form control widgets
15
+ //>>docs: http://api.jqueryui.com/controlgroup/
16
+ //>>demos: http://jqueryui.com/controlgroup/
17
+ //>>css.structure: ../../themes/base/core.css
18
+ //>>css.structure: ../../themes/base/controlgroup.css
19
+ //>>css.theme: ../../themes/base/theme.css
20
+
21
+ ( function( factory ) {
22
+ if ( typeof define === "function" && define.amd ) {
23
+
24
+ // AMD. Register as an anonymous module.
25
+ define( [
26
+ "jquery",
27
+ "../widget"
28
+ ], factory );
29
+ } else {
30
+
31
+ // Browser globals
32
+ factory( jQuery );
33
+ }
34
+ }( function( $ ) {
35
+ var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g;
36
+
37
+ return $.widget( "ui.controlgroup", {
38
+ version: "1.12.1",
39
+ defaultElement: "<div>",
40
+ options: {
41
+ direction: "horizontal",
42
+ disabled: null,
43
+ onlyVisible: true,
44
+ items: {
45
+ "button": "input[type=button], input[type=submit], input[type=reset], button, a",
46
+ "controlgroupLabel": ".ui-controlgroup-label",
47
+ "checkboxradio": "input[type='checkbox'], input[type='radio']",
48
+ "selectmenu": "select",
49
+ "spinner": ".ui-spinner-input"
50
+ }
51
+ },
52
+
53
+ _create: function() {
54
+ this._enhance();
55
+ },
56
+
57
+ // To support the enhanced option in jQuery Mobile, we isolate DOM manipulation
58
+ _enhance: function() {
59
+ this.element.attr( "role", "toolbar" );
60
+ this.refresh();
61
+ },
62
+
63
+ _destroy: function() {
64
+ this._callChildMethod( "destroy" );
65
+ this.childWidgets.removeData( "ui-controlgroup-data" );
66
+ this.element.removeAttr( "role" );
67
+ if ( this.options.items.controlgroupLabel ) {
68
+ this.element
69
+ .find( this.options.items.controlgroupLabel )
70
+ .find( ".ui-controlgroup-label-contents" )
71
+ .contents().unwrap();
72
+ }
73
+ },
74
+
75
+ _initWidgets: function() {
76
+ var that = this,
77
+ childWidgets = [];
78
+
79
+ // First we iterate over each of the items options
80
+ $.each( this.options.items, function( widget, selector ) {
81
+ var labels;
82
+ var options = {};
83
+
84
+ // Make sure the widget has a selector set
85
+ if ( !selector ) {
86
+ return;
87
+ }
88
+
89
+ if ( widget === "controlgroupLabel" ) {
90
+ labels = that.element.find( selector );
91
+ labels.each( function() {
92
+ var element = $( this );
93
+
94
+ if ( element.children( ".ui-controlgroup-label-contents" ).length ) {
95
+ return;
96
+ }
97
+ element.contents()
98
+ .wrapAll( "<span class='ui-controlgroup-label-contents'></span>" );
99
+ } );
100
+ that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" );
101
+ childWidgets = childWidgets.concat( labels.get() );
102
+ return;
103
+ }
104
+
105
+ // Make sure the widget actually exists
106
+ if ( !$.fn[ widget ] ) {
107
+ return;
108
+ }
109
+
110
+ // We assume everything is in the middle to start because we can't determine
111
+ // first / last elements until all enhancments are done.
112
+ if ( that[ "_" + widget + "Options" ] ) {
113
+ options = that[ "_" + widget + "Options" ]( "middle" );
114
+ } else {
115
+ options = { classes: {} };
116
+ }
117
+
118
+ // Find instances of this widget inside controlgroup and init them
119
+ that.element
120
+ .find( selector )
121
+ .each( function() {
122
+ var element = $( this );
123
+ var instance = element[ widget ]( "instance" );
124
+
125
+ // We need to clone the default options for this type of widget to avoid
126
+ // polluting the variable options which has a wider scope than a single widget.
127
+ var instanceOptions = $.widget.extend( {}, options );
128
+
129
+ // If the button is the child of a spinner ignore it
130
+ // TODO: Find a more generic solution
131
+ if ( widget === "button" && element.parent( ".ui-spinner" ).length ) {
132
+ return;
133
+ }
134
+
135
+ // Create the widget if it doesn't exist
136
+ if ( !instance ) {
137
+ instance = element[ widget ]()[ widget ]( "instance" );
138
+ }
139
+ if ( instance ) {
140
+ instanceOptions.classes =
141
+ that._resolveClassesValues( instanceOptions.classes, instance );
142
+ }
143
+ element[ widget ]( instanceOptions );
144
+
145
+ // Store an instance of the controlgroup to be able to reference
146
+ // from the outermost element for changing options and refresh
147
+ var widgetElement = element[ widget ]( "widget" );
148
+ $.data( widgetElement[ 0 ], "ui-controlgroup-data",
149
+ instance ? instance : element[ widget ]( "instance" ) );
150
+
151
+ childWidgets.push( widgetElement[ 0 ] );
152
+ } );
153
+ } );
154
+
155
+ this.childWidgets = $( $.unique( childWidgets ) );
156
+ this._addClass( this.childWidgets, "ui-controlgroup-item" );
157
+ },
158
+
159
+ _callChildMethod: function( method ) {
160
+ this.childWidgets.each( function() {
161
+ var element = $( this ),
162
+ data = element.data( "ui-controlgroup-data" );
163
+ if ( data && data[ method ] ) {
164
+ data[ method ]();
165
+ }
166
+ } );
167
+ },
168
+
169
+ _updateCornerClass: function( element, position ) {
170
+ var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";
171
+ var add = this._buildSimpleOptions( position, "label" ).classes.label;
172
+
173
+ this._removeClass( element, null, remove );
174
+ this._addClass( element, null, add );
175
+ },
176
+
177
+ _buildSimpleOptions: function( position, key ) {
178
+ var direction = this.options.direction === "vertical";
179
+ var result = {
180
+ classes: {}
181
+ };
182
+ result.classes[ key ] = {
183
+ "middle": "",
184
+ "first": "ui-corner-" + ( direction ? "top" : "left" ),
185
+ "last": "ui-corner-" + ( direction ? "bottom" : "right" ),
186
+ "only": "ui-corner-all"
187
+ }[ position ];
188
+
189
+ return result;
190
+ },
191
+
192
+ _spinnerOptions: function( position ) {
193
+ var options = this._buildSimpleOptions( position, "ui-spinner" );
194
+
195
+ options.classes[ "ui-spinner-up" ] = "";
196
+ options.classes[ "ui-spinner-down" ] = "";
197
+
198
+ return options;
199
+ },
200
+
201
+ _buttonOptions: function( position ) {
202
+ return this._buildSimpleOptions( position, "ui-button" );
203
+ },
204
+
205
+ _checkboxradioOptions: function( position ) {
206
+ return this._buildSimpleOptions( position, "ui-checkboxradio-label" );
207
+ },
208
+
209
+ _selectmenuOptions: function( position ) {
210
+ var direction = this.options.direction === "vertical";
211
+ return {
212
+ width: direction ? "auto" : false,
213
+ classes: {
214
+ middle: {
215
+ "ui-selectmenu-button-open": "",
216
+ "ui-selectmenu-button-closed": ""
217
+ },
218
+ first: {
219
+ "ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ),
220
+ "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" )
221
+ },
222
+ last: {
223
+ "ui-selectmenu-button-open": direction ? "" : "ui-corner-tr",
224
+ "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" )
225
+ },
226
+ only: {
227
+ "ui-selectmenu-button-open": "ui-corner-top",
228
+ "ui-selectmenu-button-closed": "ui-corner-all"
229
+ }
230
+
231
+ }[ position ]
232
+ };
233
+ },
234
+
235
+ _resolveClassesValues: function( classes, instance ) {
236
+ var result = {};
237
+ $.each( classes, function( key ) {
238
+ var current = instance.options.classes[ key ] || "";
239
+ current = $.trim( current.replace( controlgroupCornerRegex, "" ) );
240
+ result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " );
241
+ } );
242
+ return result;
243
+ },
244
+
245
+ _setOption: function( key, value ) {
246
+ if ( key === "direction" ) {
247
+ this._removeClass( "ui-controlgroup-" + this.options.direction );
248
+ }
249
+
250
+ this._super( key, value );
251
+ if ( key === "disabled" ) {
252
+ this._callChildMethod( value ? "disable" : "enable" );
253
+ return;
254
+ }
255
+
256
+ this.refresh();
257
+ },
258
+
259
+ refresh: function() {
260
+ var children,
261
+ that = this;
262
+
263
+ this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction );
264
+
265
+ if ( this.options.direction === "horizontal" ) {
266
+ this._addClass( null, "ui-helper-clearfix" );
267
+ }
268
+ this._initWidgets();
269
+
270
+ children = this.childWidgets;
271
+
272
+ // We filter here because we need to track all childWidgets not just the visible ones
273
+ if ( this.options.onlyVisible ) {
274
+ children = children.filter( ":visible" );
275
+ }
276
+
277
+ if ( children.length ) {
278
+
279
+ // We do this last because we need to make sure all enhancment is done
280
+ // before determining first and last
281
+ $.each( [ "first", "last" ], function( index, value ) {
282
+ var instance = children[ value ]().data( "ui-controlgroup-data" );
283
+
284
+ if ( instance && that[ "_" + instance.widgetName + "Options" ] ) {
285
+ var options = that[ "_" + instance.widgetName + "Options" ](
286
+ children.length === 1 ? "only" : value
287
+ );
288
+ options.classes = that._resolveClassesValues( options.classes, instance );
289
+ instance.element[ instance.widgetName ]( options );
290
+ } else {
291
+ that._updateCornerClass( children[ value ](), value );
292
+ }
293
+ } );
294
+
295
+ // Finally call the refresh method on each of the child widgets.
296
+ this._callChildMethod( "refresh" );
297
+ }
298
+ }
299
+ } );
300
+ } ) );