jquery-ui-rails 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of jquery-ui-rails might be problematic. Click here for more details.

Files changed (64) hide show
  1. data/History.md +4 -0
  2. data/VERSIONS.md +1 -0
  3. data/app/assets/javascripts/jquery-ui/accordion.js +12 -3
  4. data/app/assets/javascripts/jquery-ui/autocomplete.js +2 -2
  5. data/app/assets/javascripts/jquery-ui/button.js +3 -3
  6. data/app/assets/javascripts/jquery-ui/core.js +2 -2
  7. data/app/assets/javascripts/jquery-ui/datepicker-el.js +1 -1
  8. data/app/assets/javascripts/jquery-ui/datepicker-fa.js +12 -12
  9. data/app/assets/javascripts/jquery-ui/datepicker-fr.js +1 -1
  10. data/app/assets/javascripts/jquery-ui/datepicker.js +3 -3
  11. data/app/assets/javascripts/jquery-ui/dialog.js +2 -2
  12. data/app/assets/javascripts/jquery-ui/draggable.js +290 -183
  13. data/app/assets/javascripts/jquery-ui/droppable.js +4 -4
  14. data/app/assets/javascripts/jquery-ui/effect-blind.js +1 -1
  15. data/app/assets/javascripts/jquery-ui/effect-bounce.js +1 -1
  16. data/app/assets/javascripts/jquery-ui/effect-clip.js +1 -1
  17. data/app/assets/javascripts/jquery-ui/effect-drop.js +2 -2
  18. data/app/assets/javascripts/jquery-ui/effect-explode.js +1 -1
  19. data/app/assets/javascripts/jquery-ui/effect-fade.js +1 -1
  20. data/app/assets/javascripts/jquery-ui/effect-fold.js +1 -1
  21. data/app/assets/javascripts/jquery-ui/effect-highlight.js +1 -1
  22. data/app/assets/javascripts/jquery-ui/effect-puff.js +1 -1
  23. data/app/assets/javascripts/jquery-ui/effect-pulsate.js +1 -1
  24. data/app/assets/javascripts/jquery-ui/effect-scale.js +1 -1
  25. data/app/assets/javascripts/jquery-ui/effect-shake.js +1 -1
  26. data/app/assets/javascripts/jquery-ui/effect-size.js +1 -1
  27. data/app/assets/javascripts/jquery-ui/effect-slide.js +1 -1
  28. data/app/assets/javascripts/jquery-ui/effect-transfer.js +1 -1
  29. data/app/assets/javascripts/jquery-ui/effect.js +4 -4
  30. data/app/assets/javascripts/jquery-ui/menu.js +28 -22
  31. data/app/assets/javascripts/jquery-ui/mouse.js +20 -8
  32. data/app/assets/javascripts/jquery-ui/position.js +1 -1
  33. data/app/assets/javascripts/jquery-ui/progressbar.js +2 -2
  34. data/app/assets/javascripts/jquery-ui/resizable.js +2 -2
  35. data/app/assets/javascripts/jquery-ui/selectable.js +2 -2
  36. data/app/assets/javascripts/jquery-ui/selectmenu.js +49 -5
  37. data/app/assets/javascripts/jquery-ui/slider.js +12 -4
  38. data/app/assets/javascripts/jquery-ui/sortable.js +12 -18
  39. data/app/assets/javascripts/jquery-ui/spinner.js +2 -2
  40. data/app/assets/javascripts/jquery-ui/tabs.js +13 -3
  41. data/app/assets/javascripts/jquery-ui/tooltip.js +38 -28
  42. data/app/assets/javascripts/jquery-ui/widget.js +14 -7
  43. data/app/assets/stylesheets/jquery-ui/accordion.css.erb +1 -1
  44. data/app/assets/stylesheets/jquery-ui/all.css.erb +1 -1
  45. data/app/assets/stylesheets/jquery-ui/autocomplete.css.erb +1 -1
  46. data/app/assets/stylesheets/jquery-ui/base.css.erb +1 -1
  47. data/app/assets/stylesheets/jquery-ui/button.css.erb +1 -1
  48. data/app/assets/stylesheets/jquery-ui/core.css.erb +1 -1
  49. data/app/assets/stylesheets/jquery-ui/datepicker.css.erb +1 -1
  50. data/app/assets/stylesheets/jquery-ui/dialog.css.erb +1 -1
  51. data/app/assets/stylesheets/jquery-ui/draggable.css.erb +1 -1
  52. data/app/assets/stylesheets/jquery-ui/menu.css.erb +1 -1
  53. data/app/assets/stylesheets/jquery-ui/progressbar.css.erb +1 -1
  54. data/app/assets/stylesheets/jquery-ui/resizable.css.erb +1 -1
  55. data/app/assets/stylesheets/jquery-ui/selectable.css.erb +1 -1
  56. data/app/assets/stylesheets/jquery-ui/selectmenu.css.erb +1 -1
  57. data/app/assets/stylesheets/jquery-ui/slider.css.erb +1 -1
  58. data/app/assets/stylesheets/jquery-ui/sortable.css.erb +1 -1
  59. data/app/assets/stylesheets/jquery-ui/spinner.css.erb +1 -1
  60. data/app/assets/stylesheets/jquery-ui/tabs.css.erb +1 -1
  61. data/app/assets/stylesheets/jquery-ui/theme.css.erb +1 -1
  62. data/app/assets/stylesheets/jquery-ui/tooltip.css.erb +1 -1
  63. data/lib/jquery/ui/rails/version.rb +2 -2
  64. metadata +3 -3
@@ -4,7 +4,7 @@
4
4
  //= require jquery-ui/menu
5
5
 
6
6
  /*!
7
- * jQuery UI Selectmenu 1.11.1
7
+ * jQuery UI Selectmenu 1.11.2
8
8
  * http://jqueryui.com
9
9
  *
10
10
  * Copyright 2014 jQuery Foundation and other contributors
@@ -32,7 +32,7 @@
32
32
  }(function( $ ) {
33
33
 
34
34
  return $.widget( "ui.selectmenu", {
35
- version: "1.11.1",
35
+ version: "1.11.2",
36
36
  defaultElement: "<select>",
37
37
  options: {
38
38
  appendTo: null,
@@ -149,6 +149,12 @@ return $.widget( "ui.selectmenu", {
149
149
  role: "listbox",
150
150
  select: function( event, ui ) {
151
151
  event.preventDefault();
152
+
153
+ // support: IE8
154
+ // If the item was selected via a click, the text selection
155
+ // will be destroyed in IE
156
+ that._setSelection();
157
+
152
158
  that._select( ui.item.data( "ui-selectmenu-item" ), event );
153
159
  },
154
160
  focus: function( event, ui ) {
@@ -259,6 +265,7 @@ return $.widget( "ui.selectmenu", {
259
265
  this.isOpen = false;
260
266
  this._toggleAttr();
261
267
 
268
+ this.range = null;
262
269
  this._off( this.document );
263
270
 
264
271
  this._trigger( "close", event );
@@ -347,6 +354,29 @@ return $.widget( "ui.selectmenu", {
347
354
  this[ this.isOpen ? "close" : "open" ]( event );
348
355
  },
349
356
 
357
+ _setSelection: function() {
358
+ var selection;
359
+
360
+ if ( !this.range ) {
361
+ return;
362
+ }
363
+
364
+ if ( window.getSelection ) {
365
+ selection = window.getSelection();
366
+ selection.removeAllRanges();
367
+ selection.addRange( this.range );
368
+
369
+ // support: IE8
370
+ } else {
371
+ this.range.select();
372
+ }
373
+
374
+ // support: IE
375
+ // Setting the text selection kills the button focus in IE, but
376
+ // restoring the focus doesn't kill the selection.
377
+ this.button.focus();
378
+ },
379
+
350
380
  _documentClick: {
351
381
  mousedown: function( event ) {
352
382
  if ( !this.isOpen ) {
@@ -362,11 +392,25 @@ return $.widget( "ui.selectmenu", {
362
392
  _buttonEvents: {
363
393
 
364
394
  // Prevent text selection from being reset when interacting with the selectmenu (#10144)
365
- mousedown: function( event ) {
366
- event.preventDefault();
395
+ mousedown: function() {
396
+ var selection;
397
+
398
+ if ( window.getSelection ) {
399
+ selection = window.getSelection();
400
+ if ( selection.rangeCount ) {
401
+ this.range = selection.getRangeAt( 0 );
402
+ }
403
+
404
+ // support: IE8
405
+ } else {
406
+ this.range = document.selection.createRange();
407
+ }
367
408
  },
368
409
 
369
- click: "_toggle",
410
+ click: function( event ) {
411
+ this._setSelection();
412
+ this._toggle( event );
413
+ },
370
414
 
371
415
  keydown: function( event ) {
372
416
  var preventDefault = true;
@@ -3,7 +3,7 @@
3
3
  //= require jquery-ui/mouse
4
4
 
5
5
  /*!
6
- * jQuery UI Slider 1.11.1
6
+ * jQuery UI Slider 1.11.2
7
7
  * http://jqueryui.com
8
8
  *
9
9
  * Copyright 2014 jQuery Foundation and other contributors
@@ -30,7 +30,7 @@
30
30
  }(function( $ ) {
31
31
 
32
32
  return $.widget( "ui.slider", $.ui.mouse, {
33
- version: "1.11.1",
33
+ version: "1.11.2",
34
34
  widgetEventPrefix: "slide",
35
35
 
36
36
  options: {
@@ -62,6 +62,7 @@ return $.widget( "ui.slider", $.ui.mouse, {
62
62
  this._handleIndex = null;
63
63
  this._detectOrientation();
64
64
  this._mouseInit();
65
+ this._calculateNewMax();
65
66
 
66
67
  this.element
67
68
  .addClass( "ui-slider" +
@@ -476,9 +477,11 @@ return $.widget( "ui.slider", $.ui.mouse, {
476
477
  }
477
478
  this._animateOff = false;
478
479
  break;
480
+ case "step":
479
481
  case "min":
480
482
  case "max":
481
483
  this._animateOff = true;
484
+ this._calculateNewMax();
482
485
  this._refreshValue();
483
486
  this._animateOff = false;
484
487
  break;
@@ -516,7 +519,7 @@ return $.widget( "ui.slider", $.ui.mouse, {
516
519
  // .slice() creates a copy of the array
517
520
  // this copy gets trimmed by min and max and then returned
518
521
  vals = this.options.values.slice();
519
- for ( i = 0; i < vals.length; i+= 1) {
522
+ for ( i = 0; i < vals.length; i += 1) {
520
523
  vals[ i ] = this._trimAlignValue( vals[ i ] );
521
524
  }
522
525
 
@@ -547,12 +550,17 @@ return $.widget( "ui.slider", $.ui.mouse, {
547
550
  return parseFloat( alignValue.toFixed(5) );
548
551
  },
549
552
 
553
+ _calculateNewMax: function() {
554
+ var remainder = ( this.options.max - this._valueMin() ) % this.options.step;
555
+ this.max = this.options.max - remainder;
556
+ },
557
+
550
558
  _valueMin: function() {
551
559
  return this.options.min;
552
560
  },
553
561
 
554
562
  _valueMax: function() {
555
- return this.options.max;
563
+ return this.max;
556
564
  },
557
565
 
558
566
  _refreshValue: function() {
@@ -3,7 +3,7 @@
3
3
  //= require jquery-ui/mouse
4
4
 
5
5
  /*!
6
- * jQuery UI Sortable 1.11.1
6
+ * jQuery UI Sortable 1.11.2
7
7
  * http://jqueryui.com
8
8
  *
9
9
  * Copyright 2014 jQuery Foundation and other contributors
@@ -30,7 +30,7 @@
30
30
  }(function( $ ) {
31
31
 
32
32
  return $.widget("ui.sortable", $.ui.mouse, {
33
- version: "1.11.1",
33
+ version: "1.11.2",
34
34
  widgetEventPrefix: "sort",
35
35
  ready: false,
36
36
  options: {
@@ -915,6 +915,10 @@ return $.widget("ui.sortable", $.ui.mouse, {
915
915
  }
916
916
 
917
917
  if(this.currentContainer === this.containers[innermostIndex]) {
918
+ if ( !this.currentContainer.containerCache.over ) {
919
+ this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
920
+ this.currentContainer.containerCache.over = 1;
921
+ }
918
922
  return;
919
923
  }
920
924
 
@@ -1253,18 +1257,6 @@ return $.widget("ui.sortable", $.ui.mouse, {
1253
1257
  }
1254
1258
 
1255
1259
  this.dragging = false;
1256
- if(this.cancelHelperRemoval) {
1257
- if(!noPropagation) {
1258
- this._trigger("beforeStop", event, this._uiHash());
1259
- for (i=0; i < delayedTriggers.length; i++) {
1260
- delayedTriggers[i].call(this, event);
1261
- } //Trigger all delayed events
1262
- this._trigger("stop", event, this._uiHash());
1263
- }
1264
-
1265
- this.fromOutside = false;
1266
- return false;
1267
- }
1268
1260
 
1269
1261
  if(!noPropagation) {
1270
1262
  this._trigger("beforeStop", event, this._uiHash());
@@ -1273,10 +1265,12 @@ return $.widget("ui.sortable", $.ui.mouse, {
1273
1265
  //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
1274
1266
  this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
1275
1267
 
1276
- if(this.helper[0] !== this.currentItem[0]) {
1277
- this.helper.remove();
1268
+ if ( !this.cancelHelperRemoval ) {
1269
+ if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
1270
+ this.helper.remove();
1271
+ }
1272
+ this.helper = null;
1278
1273
  }
1279
- this.helper = null;
1280
1274
 
1281
1275
  if(!noPropagation) {
1282
1276
  for (i=0; i < delayedTriggers.length; i++) {
@@ -1286,7 +1280,7 @@ return $.widget("ui.sortable", $.ui.mouse, {
1286
1280
  }
1287
1281
 
1288
1282
  this.fromOutside = false;
1289
- return true;
1283
+ return !this.cancelHelperRemoval;
1290
1284
 
1291
1285
  },
1292
1286
 
@@ -3,7 +3,7 @@
3
3
  //= require jquery-ui/button
4
4
 
5
5
  /*!
6
- * jQuery UI Spinner 1.11.1
6
+ * jQuery UI Spinner 1.11.2
7
7
  * http://jqueryui.com
8
8
  *
9
9
  * Copyright 2014 jQuery Foundation and other contributors
@@ -41,7 +41,7 @@ function spinner_modifier( fn ) {
41
41
  }
42
42
 
43
43
  return $.widget( "ui.spinner", {
44
- version: "1.11.1",
44
+ version: "1.11.2",
45
45
  defaultElement: "<input>",
46
46
  widgetEventPrefix: "spin",
47
47
  options: {
@@ -2,7 +2,7 @@
2
2
  //= require jquery-ui/widget
3
3
 
4
4
  /*!
5
- * jQuery UI Tabs 1.11.1
5
+ * jQuery UI Tabs 1.11.2
6
6
  * http://jqueryui.com
7
7
  *
8
8
  * Copyright 2014 jQuery Foundation and other contributors
@@ -28,7 +28,7 @@
28
28
  }(function( $ ) {
29
29
 
30
30
  return $.widget( "ui.tabs", {
31
- version: "1.11.1",
31
+ version: "1.11.2",
32
32
  delay: 300,
33
33
  options: {
34
34
  active: null,
@@ -375,7 +375,10 @@ return $.widget( "ui.tabs", {
375
375
  },
376
376
 
377
377
  _processTabs: function() {
378
- var that = this;
378
+ var that = this,
379
+ prevTabs = this.tabs,
380
+ prevAnchors = this.anchors,
381
+ prevPanels = this.panels;
379
382
 
380
383
  this.tablist = this._getList()
381
384
  .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
@@ -459,6 +462,13 @@ return $.widget( "ui.tabs", {
459
462
  this.panels
460
463
  .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
461
464
  .attr( "role", "tabpanel" );
465
+
466
+ // Avoid memory leaks (#10056)
467
+ if ( prevTabs ) {
468
+ this._off( prevTabs.not( this.tabs ) );
469
+ this._off( prevAnchors.not( this.anchors ) );
470
+ this._off( prevPanels.not( this.panels ) );
471
+ }
462
472
  },
463
473
 
464
474
  // allow overriding how to find the list for rare usage scenarios (#7715)
@@ -3,7 +3,7 @@
3
3
  //= require jquery-ui/position
4
4
 
5
5
  /*!
6
- * jQuery UI Tooltip 1.11.1
6
+ * jQuery UI Tooltip 1.11.2
7
7
  * http://jqueryui.com
8
8
  *
9
9
  * Copyright 2014 jQuery Foundation and other contributors
@@ -30,7 +30,7 @@
30
30
  }(function( $ ) {
31
31
 
32
32
  return $.widget( "ui.tooltip", {
33
- version: "1.11.1",
33
+ version: "1.11.2",
34
34
  options: {
35
35
  content: function() {
36
36
  // support: IE<9, Opera in jQuery <1.7
@@ -90,6 +90,7 @@ return $.widget( "ui.tooltip", {
90
90
 
91
91
  // IDs of generated tooltips, needed for destroy
92
92
  this.tooltips = {};
93
+
93
94
  // IDs of parent tooltips where we removed the title attribute
94
95
  this.parents = {};
95
96
 
@@ -121,8 +122,8 @@ return $.widget( "ui.tooltip", {
121
122
  this._super( key, value );
122
123
 
123
124
  if ( key === "content" ) {
124
- $.each( this.tooltips, function( id, element ) {
125
- that._updateContent( element );
125
+ $.each( this.tooltips, function( id, tooltipData ) {
126
+ that._updateContent( tooltipData.element );
126
127
  });
127
128
  }
128
129
  },
@@ -131,9 +132,9 @@ return $.widget( "ui.tooltip", {
131
132
  var that = this;
132
133
 
133
134
  // close open tooltips
134
- $.each( this.tooltips, function( id, element ) {
135
+ $.each( this.tooltips, function( id, tooltipData ) {
135
136
  var event = $.Event( "blur" );
136
- event.target = event.currentTarget = element[0];
137
+ event.target = event.currentTarget = tooltipData.element[ 0 ];
137
138
  that.close( event, true );
138
139
  });
139
140
 
@@ -235,7 +236,7 @@ return $.widget( "ui.tooltip", {
235
236
  },
236
237
 
237
238
  _open: function( event, target, content ) {
238
- var tooltip, events, delayedShow, a11yContent,
239
+ var tooltipData, tooltip, events, delayedShow, a11yContent,
239
240
  positionOption = $.extend( {}, this.options.position );
240
241
 
241
242
  if ( !content ) {
@@ -244,9 +245,9 @@ return $.widget( "ui.tooltip", {
244
245
 
245
246
  // Content can be updated multiple times. If the tooltip already
246
247
  // exists, then just update the content and bail.
247
- tooltip = this._find( target );
248
- if ( tooltip.length ) {
249
- tooltip.find( ".ui-tooltip-content" ).html( content );
248
+ tooltipData = this._find( target );
249
+ if ( tooltipData ) {
250
+ tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content );
250
251
  return;
251
252
  }
252
253
 
@@ -265,7 +266,8 @@ return $.widget( "ui.tooltip", {
265
266
  }
266
267
  }
267
268
 
268
- tooltip = this._tooltip( target );
269
+ tooltipData = this._tooltip( target );
270
+ tooltip = tooltipData.tooltip;
269
271
  this._addDescribedBy( target, tooltip.attr( "id" ) );
270
272
  tooltip.find( ".ui-tooltip-content" ).html( content );
271
273
 
@@ -300,8 +302,6 @@ return $.widget( "ui.tooltip", {
300
302
  }, this.options.position ) );
301
303
  }
302
304
 
303
- this.hiding = false;
304
- this.closing = false;
305
305
  tooltip.hide();
306
306
 
307
307
  this._show( tooltip, this.options.show );
@@ -347,13 +347,21 @@ return $.widget( "ui.tooltip", {
347
347
  },
348
348
 
349
349
  close: function( event ) {
350
- var that = this,
350
+ var tooltip,
351
+ that = this,
351
352
  target = $( event ? event.currentTarget : this.element ),
352
- tooltip = this._find( target );
353
+ tooltipData = this._find( target );
354
+
355
+ // The tooltip may already be closed
356
+ if ( !tooltipData ) {
357
+ return;
358
+ }
359
+
360
+ tooltip = tooltipData.tooltip;
353
361
 
354
362
  // disabling closes the tooltip, so we need to track when we're closing
355
363
  // to avoid an infinite loop in case the tooltip becomes disabled on close
356
- if ( this.closing ) {
364
+ if ( tooltipData.closing ) {
357
365
  return;
358
366
  }
359
367
 
@@ -368,12 +376,10 @@ return $.widget( "ui.tooltip", {
368
376
 
369
377
  this._removeDescribedBy( target );
370
378
 
371
- this.hiding = true;
379
+ tooltipData.hiding = true;
372
380
  tooltip.stop( true );
373
381
  this._hide( tooltip, this.options.hide, function() {
374
382
  that._removeTooltip( $( this ) );
375
- this.hiding = false;
376
- this.closing = false;
377
383
  });
378
384
 
379
385
  target.removeData( "ui-tooltip-open" );
@@ -392,10 +398,10 @@ return $.widget( "ui.tooltip", {
392
398
  });
393
399
  }
394
400
 
395
- this.closing = true;
401
+ tooltipData.closing = true;
396
402
  this._trigger( "close", event, { tooltip: tooltip } );
397
- if ( !this.hiding ) {
398
- this.closing = false;
403
+ if ( !tooltipData.hiding ) {
404
+ tooltipData.closing = false;
399
405
  }
400
406
  },
401
407
 
@@ -411,13 +417,16 @@ return $.widget( "ui.tooltip", {
411
417
  .appendTo( tooltip );
412
418
 
413
419
  tooltip.appendTo( this.document[0].body );
414
- this.tooltips[ id ] = element;
415
- return tooltip;
420
+
421
+ return this.tooltips[ id ] = {
422
+ element: element,
423
+ tooltip: tooltip
424
+ };
416
425
  },
417
426
 
418
427
  _find: function( target ) {
419
428
  var id = target.data( "ui-tooltip-id" );
420
- return id ? $( "#" + id ) : $();
429
+ return id ? this.tooltips[ id ] : null;
421
430
  },
422
431
 
423
432
  _removeTooltip: function( tooltip ) {
@@ -429,10 +438,11 @@ return $.widget( "ui.tooltip", {
429
438
  var that = this;
430
439
 
431
440
  // close open tooltips
432
- $.each( this.tooltips, function( id, element ) {
441
+ $.each( this.tooltips, function( id, tooltipData ) {
433
442
  // Delegate to close method to handle common cleanup
434
- var event = $.Event( "blur" );
435
- event.target = event.currentTarget = element[0];
443
+ var event = $.Event( "blur" ),
444
+ element = tooltipData.element;
445
+ event.target = event.currentTarget = element[ 0 ];
436
446
  that.close( event, true );
437
447
 
438
448
  // Remove immediately; destroying an open tooltip doesn't use the