jquery-ui-rails 3.0.1 → 4.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.

Files changed (61) hide show
  1. data/History.md +10 -0
  2. data/README.md +1 -1
  3. data/Rakefile +4 -5
  4. data/lib/jquery/ui/rails/version.rb +1 -1
  5. data/vendor/assets/javascripts/jquery.ui.accordion.js +130 -290
  6. data/vendor/assets/javascripts/jquery.ui.autocomplete.js +30 -18
  7. data/vendor/assets/javascripts/jquery.ui.button.js +9 -8
  8. data/vendor/assets/javascripts/jquery.ui.core.js +19 -53
  9. data/vendor/assets/javascripts/jquery.ui.datepicker-be.js +23 -0
  10. data/vendor/assets/javascripts/jquery.ui.datepicker-fr-CA.js +23 -0
  11. data/vendor/assets/javascripts/jquery.ui.datepicker-ky.js +24 -0
  12. data/vendor/assets/javascripts/jquery.ui.datepicker-nb.js +22 -0
  13. data/vendor/assets/javascripts/jquery.ui.datepicker-nn.js +22 -0
  14. data/vendor/assets/javascripts/jquery.ui.datepicker.js +1076 -878
  15. data/vendor/assets/javascripts/jquery.ui.dialog.js +456 -547
  16. data/vendor/assets/javascripts/jquery.ui.draggable.js +317 -207
  17. data/vendor/assets/javascripts/jquery.ui.droppable.js +177 -100
  18. data/vendor/assets/javascripts/jquery.ui.effect-blind.js +2 -2
  19. data/vendor/assets/javascripts/jquery.ui.effect-bounce.js +2 -2
  20. data/vendor/assets/javascripts/jquery.ui.effect-clip.js +2 -2
  21. data/vendor/assets/javascripts/jquery.ui.effect-drop.js +2 -2
  22. data/vendor/assets/javascripts/jquery.ui.effect-explode.js +2 -2
  23. data/vendor/assets/javascripts/jquery.ui.effect-fade.js +2 -2
  24. data/vendor/assets/javascripts/jquery.ui.effect-fold.js +2 -2
  25. data/vendor/assets/javascripts/jquery.ui.effect-highlight.js +2 -2
  26. data/vendor/assets/javascripts/jquery.ui.effect-pulsate.js +2 -2
  27. data/vendor/assets/javascripts/jquery.ui.effect-scale.js +2 -2
  28. data/vendor/assets/javascripts/jquery.ui.effect-shake.js +2 -2
  29. data/vendor/assets/javascripts/jquery.ui.effect-slide.js +2 -2
  30. data/vendor/assets/javascripts/jquery.ui.effect-transfer.js +3 -3
  31. data/vendor/assets/javascripts/jquery.ui.effect.js +91 -99
  32. data/vendor/assets/javascripts/jquery.ui.menu.js +20 -9
  33. data/vendor/assets/javascripts/jquery.ui.mouse.js +25 -25
  34. data/vendor/assets/javascripts/jquery.ui.position.js +39 -59
  35. data/vendor/assets/javascripts/jquery.ui.progressbar.js +73 -33
  36. data/vendor/assets/javascripts/jquery.ui.resizable.js +461 -294
  37. data/vendor/assets/javascripts/jquery.ui.selectable.js +67 -51
  38. data/vendor/assets/javascripts/jquery.ui.slider.js +100 -95
  39. data/vendor/assets/javascripts/jquery.ui.sortable.js +411 -257
  40. data/vendor/assets/javascripts/jquery.ui.spinner.js +19 -5
  41. data/vendor/assets/javascripts/jquery.ui.tabs.js +47 -567
  42. data/vendor/assets/javascripts/jquery.ui.tooltip.js +14 -10
  43. data/vendor/assets/javascripts/jquery.ui.widget.js +33 -40
  44. data/vendor/assets/stylesheets/jquery.ui.accordion.css.erb +30 -8
  45. data/vendor/assets/stylesheets/jquery.ui.all.css.erb +2 -2
  46. data/vendor/assets/stylesheets/jquery.ui.autocomplete.css.erb +2 -5
  47. data/vendor/assets/stylesheets/jquery.ui.base.css.erb +2 -2
  48. data/vendor/assets/stylesheets/jquery.ui.button.css.erb +100 -26
  49. data/vendor/assets/stylesheets/jquery.ui.core.css.erb +65 -12
  50. data/vendor/assets/stylesheets/jquery.ui.datepicker.css.erb +166 -55
  51. data/vendor/assets/stylesheets/jquery.ui.dialog.css.erb +61 -14
  52. data/vendor/assets/stylesheets/jquery.ui.menu.css.erb +61 -14
  53. data/vendor/assets/stylesheets/jquery.ui.progressbar.css.erb +20 -4
  54. data/vendor/assets/stylesheets/jquery.ui.resizable.css.erb +70 -13
  55. data/vendor/assets/stylesheets/jquery.ui.selectable.css.erb +7 -3
  56. data/vendor/assets/stylesheets/jquery.ui.slider.css.erb +63 -15
  57. data/vendor/assets/stylesheets/jquery.ui.spinner.css.erb +52 -10
  58. data/vendor/assets/stylesheets/jquery.ui.tabs.css.erb +44 -10
  59. data/vendor/assets/stylesheets/jquery.ui.theme.css.erb +196 -38
  60. data/vendor/assets/stylesheets/jquery.ui.tooltip.css.erb +4 -6
  61. metadata +8 -3
@@ -3,10 +3,10 @@
3
3
  //= require jquery.ui.mouse
4
4
 
5
5
  /*!
6
- * jQuery UI Selectable 1.9.2
6
+ * jQuery UI Selectable 1.10.0
7
7
  * http://jqueryui.com
8
8
  *
9
- * Copyright 2012 jQuery Foundation and other contributors
9
+ * Copyright 2013 jQuery Foundation and other contributors
10
10
  * Released under the MIT license.
11
11
  * http://jquery.org/license
12
12
  *
@@ -20,29 +20,37 @@
20
20
  (function( $, undefined ) {
21
21
 
22
22
  $.widget("ui.selectable", $.ui.mouse, {
23
- version: "1.9.2",
23
+ version: "1.10.0",
24
24
  options: {
25
- appendTo: 'body',
25
+ appendTo: "body",
26
26
  autoRefresh: true,
27
27
  distance: 0,
28
- filter: '*',
29
- tolerance: 'touch'
28
+ filter: "*",
29
+ tolerance: "touch",
30
+
31
+ // callbacks
32
+ selected: null,
33
+ selecting: null,
34
+ start: null,
35
+ stop: null,
36
+ unselected: null,
37
+ unselecting: null
30
38
  },
31
39
  _create: function() {
32
- var that = this;
40
+ var selectees,
41
+ that = this;
33
42
 
34
43
  this.element.addClass("ui-selectable");
35
44
 
36
45
  this.dragged = false;
37
46
 
38
47
  // cache selectee children based on filter
39
- var selectees;
40
48
  this.refresh = function() {
41
49
  selectees = $(that.options.filter, that.element[0]);
42
50
  selectees.addClass("ui-selectee");
43
51
  selectees.each(function() {
44
- var $this = $(this);
45
- var pos = $this.offset();
52
+ var $this = $(this),
53
+ pos = $this.offset();
46
54
  $.data(this, "selectable-item", {
47
55
  element: this,
48
56
  $element: $this,
@@ -51,9 +59,9 @@ $.widget("ui.selectable", $.ui.mouse, {
51
59
  right: pos.left + $this.outerWidth(),
52
60
  bottom: pos.top + $this.outerHeight(),
53
61
  startselected: false,
54
- selected: $this.hasClass('ui-selected'),
55
- selecting: $this.hasClass('ui-selecting'),
56
- unselecting: $this.hasClass('ui-unselecting')
62
+ selected: $this.hasClass("ui-selected"),
63
+ selecting: $this.hasClass("ui-selecting"),
64
+ unselecting: $this.hasClass("ui-unselecting")
57
65
  });
58
66
  });
59
67
  };
@@ -76,14 +84,14 @@ $.widget("ui.selectable", $.ui.mouse, {
76
84
  },
77
85
 
78
86
  _mouseStart: function(event) {
79
- var that = this;
87
+ var that = this,
88
+ options = this.options;
80
89
 
81
90
  this.opos = [event.pageX, event.pageY];
82
91
 
83
- if (this.options.disabled)
92
+ if (this.options.disabled) {
84
93
  return;
85
-
86
- var options = this.options;
94
+ }
87
95
 
88
96
  this.selectees = $(options.filter, this.element[0]);
89
97
 
@@ -92,8 +100,8 @@ $.widget("ui.selectable", $.ui.mouse, {
92
100
  $(options.appendTo).append(this.helper);
93
101
  // position helper (lasso)
94
102
  this.helper.css({
95
- "left": event.clientX,
96
- "top": event.clientY,
103
+ "left": event.pageX,
104
+ "top": event.pageY,
97
105
  "width": 0,
98
106
  "height": 0
99
107
  });
@@ -102,13 +110,13 @@ $.widget("ui.selectable", $.ui.mouse, {
102
110
  this.refresh();
103
111
  }
104
112
 
105
- this.selectees.filter('.ui-selected').each(function() {
113
+ this.selectees.filter(".ui-selected").each(function() {
106
114
  var selectee = $.data(this, "selectable-item");
107
115
  selectee.startselected = true;
108
116
  if (!event.metaKey && !event.ctrlKey) {
109
- selectee.$element.removeClass('ui-selected');
117
+ selectee.$element.removeClass("ui-selected");
110
118
  selectee.selected = false;
111
- selectee.$element.addClass('ui-unselecting');
119
+ selectee.$element.addClass("ui-unselecting");
112
120
  selectee.unselecting = true;
113
121
  // selectable UNSELECTING callback
114
122
  that._trigger("unselecting", event, {
@@ -117,10 +125,11 @@ $.widget("ui.selectable", $.ui.mouse, {
117
125
  }
118
126
  });
119
127
 
120
- $(event.target).parents().andSelf().each(function() {
121
- var selectee = $.data(this, "selectable-item");
128
+ $(event.target).parents().addBack().each(function() {
129
+ var doSelect,
130
+ selectee = $.data(this, "selectable-item");
122
131
  if (selectee) {
123
- var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected');
132
+ doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass("ui-selected");
124
133
  selectee.$element
125
134
  .removeClass(doSelect ? "ui-unselecting" : "ui-selected")
126
135
  .addClass(doSelect ? "ui-selecting" : "ui-unselecting");
@@ -144,43 +153,52 @@ $.widget("ui.selectable", $.ui.mouse, {
144
153
  },
145
154
 
146
155
  _mouseDrag: function(event) {
147
- var that = this;
156
+
148
157
  this.dragged = true;
149
158
 
150
- if (this.options.disabled)
159
+ if (this.options.disabled) {
151
160
  return;
161
+ }
152
162
 
153
- var options = this.options;
163
+ var tmp,
164
+ that = this,
165
+ options = this.options,
166
+ x1 = this.opos[0],
167
+ y1 = this.opos[1],
168
+ x2 = event.pageX,
169
+ y2 = event.pageY;
154
170
 
155
- var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY;
156
- if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
157
- if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
171
+ if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
172
+ if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; }
158
173
  this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
159
174
 
160
175
  this.selectees.each(function() {
161
- var selectee = $.data(this, "selectable-item");
176
+ var selectee = $.data(this, "selectable-item"),
177
+ hit = false;
178
+
162
179
  //prevent helper from being selected if appendTo: selectable
163
- if (!selectee || selectee.element == that.element[0])
180
+ if (!selectee || selectee.element === that.element[0]) {
164
181
  return;
165
- var hit = false;
166
- if (options.tolerance == 'touch') {
182
+ }
183
+
184
+ if (options.tolerance === "touch") {
167
185
  hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
168
- } else if (options.tolerance == 'fit') {
186
+ } else if (options.tolerance === "fit") {
169
187
  hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
170
188
  }
171
189
 
172
190
  if (hit) {
173
191
  // SELECT
174
192
  if (selectee.selected) {
175
- selectee.$element.removeClass('ui-selected');
193
+ selectee.$element.removeClass("ui-selected");
176
194
  selectee.selected = false;
177
195
  }
178
196
  if (selectee.unselecting) {
179
- selectee.$element.removeClass('ui-unselecting');
197
+ selectee.$element.removeClass("ui-unselecting");
180
198
  selectee.unselecting = false;
181
199
  }
182
200
  if (!selectee.selecting) {
183
- selectee.$element.addClass('ui-selecting');
201
+ selectee.$element.addClass("ui-selecting");
184
202
  selectee.selecting = true;
185
203
  // selectable SELECTING callback
186
204
  that._trigger("selecting", event, {
@@ -191,15 +209,15 @@ $.widget("ui.selectable", $.ui.mouse, {
191
209
  // UNSELECT
192
210
  if (selectee.selecting) {
193
211
  if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
194
- selectee.$element.removeClass('ui-selecting');
212
+ selectee.$element.removeClass("ui-selecting");
195
213
  selectee.selecting = false;
196
- selectee.$element.addClass('ui-selected');
214
+ selectee.$element.addClass("ui-selected");
197
215
  selectee.selected = true;
198
216
  } else {
199
- selectee.$element.removeClass('ui-selecting');
217
+ selectee.$element.removeClass("ui-selecting");
200
218
  selectee.selecting = false;
201
219
  if (selectee.startselected) {
202
- selectee.$element.addClass('ui-unselecting');
220
+ selectee.$element.addClass("ui-unselecting");
203
221
  selectee.unselecting = true;
204
222
  }
205
223
  // selectable UNSELECTING callback
@@ -210,10 +228,10 @@ $.widget("ui.selectable", $.ui.mouse, {
210
228
  }
211
229
  if (selectee.selected) {
212
230
  if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
213
- selectee.$element.removeClass('ui-selected');
231
+ selectee.$element.removeClass("ui-selected");
214
232
  selectee.selected = false;
215
233
 
216
- selectee.$element.addClass('ui-unselecting');
234
+ selectee.$element.addClass("ui-unselecting");
217
235
  selectee.unselecting = true;
218
236
  // selectable UNSELECTING callback
219
237
  that._trigger("unselecting", event, {
@@ -232,20 +250,18 @@ $.widget("ui.selectable", $.ui.mouse, {
232
250
 
233
251
  this.dragged = false;
234
252
 
235
- var options = this.options;
236
-
237
- $('.ui-unselecting', this.element[0]).each(function() {
253
+ $(".ui-unselecting", this.element[0]).each(function() {
238
254
  var selectee = $.data(this, "selectable-item");
239
- selectee.$element.removeClass('ui-unselecting');
255
+ selectee.$element.removeClass("ui-unselecting");
240
256
  selectee.unselecting = false;
241
257
  selectee.startselected = false;
242
258
  that._trigger("unselected", event, {
243
259
  unselected: selectee.element
244
260
  });
245
261
  });
246
- $('.ui-selecting', this.element[0]).each(function() {
262
+ $(".ui-selecting", this.element[0]).each(function() {
247
263
  var selectee = $.data(this, "selectable-item");
248
- selectee.$element.removeClass('ui-selecting').addClass('ui-selected');
264
+ selectee.$element.removeClass("ui-selecting").addClass("ui-selected");
249
265
  selectee.selecting = false;
250
266
  selectee.selected = true;
251
267
  selectee.startselected = true;
@@ -3,10 +3,10 @@
3
3
  //= require jquery.ui.mouse
4
4
 
5
5
  /*!
6
- * jQuery UI Slider 1.9.2
6
+ * jQuery UI Slider 1.10.0
7
7
  * http://jqueryui.com
8
8
  *
9
- * Copyright 2012 jQuery Foundation and other contributors
9
+ * Copyright 2013 jQuery Foundation and other contributors
10
10
  * Released under the MIT license.
11
11
  * http://jquery.org/license
12
12
  *
@@ -24,7 +24,7 @@
24
24
  var numPages = 5;
25
25
 
26
26
  $.widget( "ui.slider", $.ui.mouse, {
27
- version: "1.9.2",
27
+ version: "1.10.0",
28
28
  widgetEventPrefix: "slide",
29
29
 
30
30
  options: {
@@ -36,7 +36,13 @@ $.widget( "ui.slider", $.ui.mouse, {
36
36
  range: false,
37
37
  step: 1,
38
38
  value: 0,
39
- values: null
39
+ values: null,
40
+
41
+ // callbacks
42
+ change: null,
43
+ slide: null,
44
+ start: null,
45
+ stop: null
40
46
  },
41
47
 
42
48
  _create: function() {
@@ -58,8 +64,7 @@ $.widget( "ui.slider", $.ui.mouse, {
58
64
  " ui-slider-" + this.orientation +
59
65
  " ui-widget" +
60
66
  " ui-widget-content" +
61
- " ui-corner-all" +
62
- ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) );
67
+ " ui-corner-all");
63
68
 
64
69
  this.range = $([]);
65
70
 
@@ -67,9 +72,10 @@ $.widget( "ui.slider", $.ui.mouse, {
67
72
  if ( o.range === true ) {
68
73
  if ( !o.values ) {
69
74
  o.values = [ this._valueMin(), this._valueMin() ];
70
- }
71
- if ( o.values.length && o.values.length !== 2 ) {
75
+ } else if ( o.values.length && o.values.length !== 2 ) {
72
76
  o.values = [ o.values[0], o.values[0] ];
77
+ } else if ( $.isArray( o.values ) ) {
78
+ o.values = o.values.slice(0);
73
79
  }
74
80
  }
75
81
 
@@ -120,81 +126,9 @@ $.widget( "ui.slider", $.ui.mouse, {
120
126
  $( this ).data( "ui-slider-handle-index", i );
121
127
  });
122
128
 
123
- this._on( this.handles, {
124
- keydown: function( event ) {
125
- var allowed, curVal, newVal, step,
126
- index = $( event.target ).data( "ui-slider-handle-index" );
127
-
128
- switch ( event.keyCode ) {
129
- case $.ui.keyCode.HOME:
130
- case $.ui.keyCode.END:
131
- case $.ui.keyCode.PAGE_UP:
132
- case $.ui.keyCode.PAGE_DOWN:
133
- case $.ui.keyCode.UP:
134
- case $.ui.keyCode.RIGHT:
135
- case $.ui.keyCode.DOWN:
136
- case $.ui.keyCode.LEFT:
137
- event.preventDefault();
138
- if ( !this._keySliding ) {
139
- this._keySliding = true;
140
- $( event.target ).addClass( "ui-state-active" );
141
- allowed = this._start( event, index );
142
- if ( allowed === false ) {
143
- return;
144
- }
145
- }
146
- break;
147
- }
148
-
149
- step = this.options.step;
150
- if ( this.options.values && this.options.values.length ) {
151
- curVal = newVal = this.values( index );
152
- } else {
153
- curVal = newVal = this.value();
154
- }
155
-
156
- switch ( event.keyCode ) {
157
- case $.ui.keyCode.HOME:
158
- newVal = this._valueMin();
159
- break;
160
- case $.ui.keyCode.END:
161
- newVal = this._valueMax();
162
- break;
163
- case $.ui.keyCode.PAGE_UP:
164
- newVal = this._trimAlignValue( curVal + ( (this._valueMax() - this._valueMin()) / numPages ) );
165
- break;
166
- case $.ui.keyCode.PAGE_DOWN:
167
- newVal = this._trimAlignValue( curVal - ( (this._valueMax() - this._valueMin()) / numPages ) );
168
- break;
169
- case $.ui.keyCode.UP:
170
- case $.ui.keyCode.RIGHT:
171
- if ( curVal === this._valueMax() ) {
172
- return;
173
- }
174
- newVal = this._trimAlignValue( curVal + step );
175
- break;
176
- case $.ui.keyCode.DOWN:
177
- case $.ui.keyCode.LEFT:
178
- if ( curVal === this._valueMin() ) {
179
- return;
180
- }
181
- newVal = this._trimAlignValue( curVal - step );
182
- break;
183
- }
184
-
185
- this._slide( event, index, newVal );
186
- },
187
- keyup: function( event ) {
188
- var index = $( event.target ).data( "ui-slider-handle-index" );
129
+ this._setOption( "disabled", o.disabled );
189
130
 
190
- if ( this._keySliding ) {
191
- this._keySliding = false;
192
- this._stop( event, index );
193
- this._change( event, index );
194
- $( event.target ).removeClass( "ui-state-active" );
195
- }
196
- }
197
- });
131
+ this._on( this.handles, this._handleEvents );
198
132
 
199
133
  this._refreshValue();
200
134
 
@@ -209,7 +143,6 @@ $.widget( "ui.slider", $.ui.mouse, {
209
143
  .removeClass( "ui-slider" +
210
144
  " ui-slider-horizontal" +
211
145
  " ui-slider-vertical" +
212
- " ui-slider-disabled" +
213
146
  " ui-widget" +
214
147
  " ui-widget-content" +
215
148
  " ui-corner-all" );
@@ -237,21 +170,15 @@ $.widget( "ui.slider", $.ui.mouse, {
237
170
  distance = this._valueMax() - this._valueMin() + 1;
238
171
  this.handles.each(function( i ) {
239
172
  var thisDistance = Math.abs( normValue - that.values(i) );
240
- if ( distance > thisDistance ) {
173
+ if (( distance > thisDistance ) ||
174
+ ( distance === thisDistance &&
175
+ (i === that._lastChangedValue || that.values(i) === o.min ))) {
241
176
  distance = thisDistance;
242
177
  closestHandle = $( this );
243
178
  index = i;
244
179
  }
245
180
  });
246
181
 
247
- // workaround for bug #3736 (if both handles of a range are at 0,
248
- // the first is always used as the one with least distance,
249
- // and moving it is obviously prevented by preventing negative ranges)
250
- if( o.range === true && this.values(1) === o.min ) {
251
- index += 1;
252
- closestHandle = $( this.handles[index] );
253
- }
254
-
255
182
  allowed = this._start( event, index );
256
183
  if ( allowed === false ) {
257
184
  return false;
@@ -265,7 +192,7 @@ $.widget( "ui.slider", $.ui.mouse, {
265
192
  .focus();
266
193
 
267
194
  offset = closestHandle.offset();
268
- mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" );
195
+ mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
269
196
  this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
270
197
  left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
271
198
  top: event.pageY - offset.top -
@@ -423,6 +350,9 @@ $.widget( "ui.slider", $.ui.mouse, {
423
350
  uiHash.values = this.values();
424
351
  }
425
352
 
353
+ //store the last changed value index for reference when handles overlap
354
+ this._lastChangedValue = index;
355
+
426
356
  this._trigger( "change", event, uiHash );
427
357
  }
428
358
  },
@@ -487,10 +417,8 @@ $.widget( "ui.slider", $.ui.mouse, {
487
417
  this.handles.filter( ".ui-state-focus" ).blur();
488
418
  this.handles.removeClass( "ui-state-hover" );
489
419
  this.handles.prop( "disabled", true );
490
- this.element.addClass( "ui-disabled" );
491
420
  } else {
492
421
  this.handles.prop( "disabled", false );
493
- this.element.removeClass( "ui-disabled" );
494
422
  }
495
423
  break;
496
424
  case "orientation":
@@ -641,6 +569,83 @@ $.widget( "ui.slider", $.ui.mouse, {
641
569
  this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
642
570
  }
643
571
  }
572
+ },
573
+
574
+ _handleEvents: {
575
+ keydown: function( event ) {
576
+ /*jshint maxcomplexity:25*/
577
+ var allowed, curVal, newVal, step,
578
+ index = $( event.target ).data( "ui-slider-handle-index" );
579
+
580
+ switch ( event.keyCode ) {
581
+ case $.ui.keyCode.HOME:
582
+ case $.ui.keyCode.END:
583
+ case $.ui.keyCode.PAGE_UP:
584
+ case $.ui.keyCode.PAGE_DOWN:
585
+ case $.ui.keyCode.UP:
586
+ case $.ui.keyCode.RIGHT:
587
+ case $.ui.keyCode.DOWN:
588
+ case $.ui.keyCode.LEFT:
589
+ event.preventDefault();
590
+ if ( !this._keySliding ) {
591
+ this._keySliding = true;
592
+ $( event.target ).addClass( "ui-state-active" );
593
+ allowed = this._start( event, index );
594
+ if ( allowed === false ) {
595
+ return;
596
+ }
597
+ }
598
+ break;
599
+ }
600
+
601
+ step = this.options.step;
602
+ if ( this.options.values && this.options.values.length ) {
603
+ curVal = newVal = this.values( index );
604
+ } else {
605
+ curVal = newVal = this.value();
606
+ }
607
+
608
+ switch ( event.keyCode ) {
609
+ case $.ui.keyCode.HOME:
610
+ newVal = this._valueMin();
611
+ break;
612
+ case $.ui.keyCode.END:
613
+ newVal = this._valueMax();
614
+ break;
615
+ case $.ui.keyCode.PAGE_UP:
616
+ newVal = this._trimAlignValue( curVal + ( (this._valueMax() - this._valueMin()) / numPages ) );
617
+ break;
618
+ case $.ui.keyCode.PAGE_DOWN:
619
+ newVal = this._trimAlignValue( curVal - ( (this._valueMax() - this._valueMin()) / numPages ) );
620
+ break;
621
+ case $.ui.keyCode.UP:
622
+ case $.ui.keyCode.RIGHT:
623
+ if ( curVal === this._valueMax() ) {
624
+ return;
625
+ }
626
+ newVal = this._trimAlignValue( curVal + step );
627
+ break;
628
+ case $.ui.keyCode.DOWN:
629
+ case $.ui.keyCode.LEFT:
630
+ if ( curVal === this._valueMin() ) {
631
+ return;
632
+ }
633
+ newVal = this._trimAlignValue( curVal - step );
634
+ break;
635
+ }
636
+
637
+ this._slide( event, index, newVal );
638
+ },
639
+ keyup: function( event ) {
640
+ var index = $( event.target ).data( "ui-slider-handle-index" );
641
+
642
+ if ( this._keySliding ) {
643
+ this._keySliding = false;
644
+ this._stop( event, index );
645
+ this._change( event, index );
646
+ $( event.target ).removeClass( "ui-state-active" );
647
+ }
648
+ }
644
649
  }
645
650
 
646
651
  });