activeadmin 3.4.0 → 3.5.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/app/assets/javascripts/active_admin/base.js +1 -0
- data/app/javascript/active_admin/initializers/datepicker.js +3 -0
- data/lib/active_admin/dependency.rb +1 -1
- data/lib/active_admin/resource.rb +8 -2
- data/lib/active_admin/version.rb +1 -1
- data/vendor/assets/javascripts/jquery-ui/data.js +6 -12
- data/vendor/assets/javascripts/jquery-ui/disable-selection.js +1 -1
- data/vendor/assets/javascripts/jquery-ui/focusable.js +3 -13
- data/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js +2 -4
- data/vendor/assets/javascripts/jquery-ui/keycode.js +1 -1
- data/vendor/assets/javascripts/jquery-ui/labels.js +4 -5
- data/vendor/assets/javascripts/jquery-ui/position.js +1 -1
- data/vendor/assets/javascripts/jquery-ui/scroll-parent.js +1 -1
- data/vendor/assets/javascripts/jquery-ui/tabbable.js +1 -1
- data/vendor/assets/javascripts/jquery-ui/unique-id.js +1 -1
- data/vendor/assets/javascripts/jquery-ui/version.js +1 -1
- data/vendor/assets/javascripts/jquery-ui/widget.js +4 -1
- data/vendor/assets/javascripts/jquery-ui/widgets/button.js +6 -6
- data/vendor/assets/javascripts/jquery-ui/widgets/checkboxradio.js +4 -4
- data/vendor/assets/javascripts/jquery-ui/widgets/controlgroup.js +2 -2
- data/vendor/assets/javascripts/jquery-ui/widgets/datepicker.js +11 -14
- data/vendor/assets/javascripts/jquery-ui/widgets/dialog.js +20 -34
- data/vendor/assets/javascripts/jquery-ui/widgets/draggable.js +4 -8
- data/vendor/assets/javascripts/jquery-ui/widgets/mouse.js +16 -31
- data/vendor/assets/javascripts/jquery-ui/widgets/resizable.js +73 -20
- data/vendor/assets/javascripts/jquery-ui/widgets/sortable.js +9 -17
- data/vendor/assets/javascripts/jquery-ui/widgets/tabs.js +53 -66
- metadata +2 -6
- data/vendor/assets/javascripts/jquery-ui/form.js +0 -25
- data/vendor/assets/javascripts/jquery-ui/ie.js +0 -20
- data/vendor/assets/javascripts/jquery-ui/safe-active-element.js +0 -46
- data/vendor/assets/javascripts/jquery-ui/safe-blur.js +0 -27
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
//= require jquery-ui/widgets/mouse
|
|
2
2
|
//= require jquery-ui/data
|
|
3
3
|
//= require jquery-ui/plugin
|
|
4
|
-
//= require jquery-ui/safe-active-element
|
|
5
|
-
//= require jquery-ui/safe-blur
|
|
6
4
|
//= require jquery-ui/scroll-parent
|
|
7
5
|
//= require jquery-ui/version
|
|
8
6
|
//= require jquery-ui/widget
|
|
9
7
|
|
|
10
8
|
/*!
|
|
11
|
-
* jQuery UI Draggable 1.
|
|
9
|
+
* jQuery UI Draggable 1.14.2
|
|
12
10
|
* https://jqueryui.com
|
|
13
11
|
*
|
|
14
12
|
* Copyright OpenJS Foundation and other contributors
|
|
@@ -34,8 +32,6 @@
|
|
|
34
32
|
"./mouse",
|
|
35
33
|
"../data",
|
|
36
34
|
"../plugin",
|
|
37
|
-
"../safe-active-element",
|
|
38
|
-
"../safe-blur",
|
|
39
35
|
"../scroll-parent",
|
|
40
36
|
"../version",
|
|
41
37
|
"../widget"
|
|
@@ -49,7 +45,7 @@
|
|
|
49
45
|
"use strict";
|
|
50
46
|
|
|
51
47
|
$.widget( "ui.draggable", $.ui.mouse, {
|
|
52
|
-
version: "1.
|
|
48
|
+
version: "1.14.2",
|
|
53
49
|
widgetEventPrefix: "drag",
|
|
54
50
|
options: {
|
|
55
51
|
addClasses: true,
|
|
@@ -156,7 +152,7 @@ $.widget( "ui.draggable", $.ui.mouse, {
|
|
|
156
152
|
},
|
|
157
153
|
|
|
158
154
|
_blurActiveElement: function( event ) {
|
|
159
|
-
var activeElement =
|
|
155
|
+
var activeElement = this.document[ 0 ].activeElement,
|
|
160
156
|
target = $( event.target );
|
|
161
157
|
|
|
162
158
|
// Don't blur if the event occurred on an element that is within
|
|
@@ -167,7 +163,7 @@ $.widget( "ui.draggable", $.ui.mouse, {
|
|
|
167
163
|
}
|
|
168
164
|
|
|
169
165
|
// Blur any element that currently has focus, see #4261
|
|
170
|
-
|
|
166
|
+
$( activeElement ).trigger( "blur" );
|
|
171
167
|
},
|
|
172
168
|
|
|
173
169
|
_mouseStart: function( event ) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
//= require jquery-ui/ie
|
|
2
1
|
//= require jquery-ui/version
|
|
3
2
|
//= require jquery-ui/widget
|
|
4
3
|
|
|
5
4
|
/*!
|
|
6
|
-
* jQuery UI Mouse 1.
|
|
5
|
+
* jQuery UI Mouse 1.14.2
|
|
7
6
|
* https://jqueryui.com
|
|
8
7
|
*
|
|
9
8
|
* Copyright OpenJS Foundation and other contributors
|
|
@@ -24,7 +23,6 @@
|
|
|
24
23
|
// AMD. Register as an anonymous module.
|
|
25
24
|
define( [
|
|
26
25
|
"jquery",
|
|
27
|
-
"../ie",
|
|
28
26
|
"../version",
|
|
29
27
|
"../widget"
|
|
30
28
|
], factory );
|
|
@@ -42,7 +40,7 @@ $( document ).on( "mouseup", function() {
|
|
|
42
40
|
} );
|
|
43
41
|
|
|
44
42
|
return $.widget( "ui.mouse", {
|
|
45
|
-
version: "1.
|
|
43
|
+
version: "1.14.2",
|
|
46
44
|
options: {
|
|
47
45
|
cancel: "input, textarea, button, select, option",
|
|
48
46
|
distance: 1,
|
|
@@ -94,12 +92,10 @@ return $.widget( "ui.mouse", {
|
|
|
94
92
|
this._mouseDownEvent = event;
|
|
95
93
|
|
|
96
94
|
var that = this,
|
|
97
|
-
btnIsLeft =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ?
|
|
102
|
-
$( event.target ).closest( this.options.cancel ).length : false );
|
|
95
|
+
btnIsLeft = event.which === 1,
|
|
96
|
+
elIsCancel = typeof this.options.cancel === "string" ?
|
|
97
|
+
$( event.target ).closest( this.options.cancel ).length :
|
|
98
|
+
false;
|
|
103
99
|
if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
|
|
104
100
|
return true;
|
|
105
101
|
}
|
|
@@ -145,28 +141,17 @@ return $.widget( "ui.mouse", {
|
|
|
145
141
|
_mouseMove: function( event ) {
|
|
146
142
|
|
|
147
143
|
// Only check for mouseups outside the document if you've moved inside the document
|
|
148
|
-
// at least once.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
//
|
|
154
|
-
if (
|
|
155
|
-
|
|
144
|
+
// at least once.
|
|
145
|
+
if ( this._mouseMoved && !event.which ) {
|
|
146
|
+
|
|
147
|
+
// Support: Safari <=8 - 9
|
|
148
|
+
// Safari sets which to 0 if you press any of the following keys
|
|
149
|
+
// during a drag (#14461)
|
|
150
|
+
if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
|
|
151
|
+
event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
|
|
152
|
+
this.ignoreMissingWhich = true;
|
|
153
|
+
} else if ( !this.ignoreMissingWhich ) {
|
|
156
154
|
return this._mouseUp( event );
|
|
157
|
-
|
|
158
|
-
// Iframe mouseup check - mouseup occurred in another document
|
|
159
|
-
} else if ( !event.which ) {
|
|
160
|
-
|
|
161
|
-
// Support: Safari <=8 - 9
|
|
162
|
-
// Safari sets which to 0 if you press any of the following keys
|
|
163
|
-
// during a drag (#14461)
|
|
164
|
-
if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
|
|
165
|
-
event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
|
|
166
|
-
this.ignoreMissingWhich = true;
|
|
167
|
-
} else if ( !this.ignoreMissingWhich ) {
|
|
168
|
-
return this._mouseUp( event );
|
|
169
|
-
}
|
|
170
155
|
}
|
|
171
156
|
}
|
|
172
157
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
//= require jquery-ui/widget
|
|
6
6
|
|
|
7
7
|
/*!
|
|
8
|
-
* jQuery UI Resizable 1.
|
|
8
|
+
* jQuery UI Resizable 1.14.2
|
|
9
9
|
* https://jqueryui.com
|
|
10
10
|
*
|
|
11
11
|
* Copyright OpenJS Foundation and other contributors
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"use strict";
|
|
46
46
|
|
|
47
47
|
$.widget( "ui.resizable", $.ui.mouse, {
|
|
48
|
-
version: "1.
|
|
48
|
+
version: "1.14.2",
|
|
49
49
|
widgetEventPrefix: "resize",
|
|
50
50
|
options: {
|
|
51
51
|
alsoResize: false,
|
|
@@ -86,12 +86,18 @@ $.widget( "ui.resizable", $.ui.mouse, {
|
|
|
86
86
|
|
|
87
87
|
_hasScroll: function( el, a ) {
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
var scroll,
|
|
90
|
+
has = false,
|
|
91
|
+
overflow = $( el ).css( "overflow" );
|
|
92
|
+
|
|
93
|
+
if ( overflow === "hidden" ) {
|
|
90
94
|
return false;
|
|
91
95
|
}
|
|
96
|
+
if ( overflow === "scroll" ) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
92
99
|
|
|
93
|
-
|
|
94
|
-
has = false;
|
|
100
|
+
scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop";
|
|
95
101
|
|
|
96
102
|
if ( el[ scroll ] > 0 ) {
|
|
97
103
|
return true;
|
|
@@ -104,7 +110,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
|
|
|
104
110
|
el[ scroll ] = 1;
|
|
105
111
|
has = ( el[ scroll ] > 0 );
|
|
106
112
|
el[ scroll ] = 0;
|
|
107
|
-
} catch (
|
|
113
|
+
} catch ( _e ) {
|
|
108
114
|
|
|
109
115
|
// `el` might be a string, then setting `scroll` will throw
|
|
110
116
|
// an error in strict mode; ignore it.
|
|
@@ -155,9 +161,8 @@ $.widget( "ui.resizable", $.ui.mouse, {
|
|
|
155
161
|
};
|
|
156
162
|
|
|
157
163
|
this.element.css( margins );
|
|
158
|
-
this.originalElement.css( "margin", 0 );
|
|
159
164
|
|
|
160
|
-
//
|
|
165
|
+
// Support: Safari
|
|
161
166
|
// Prevent Safari textarea resize
|
|
162
167
|
this.originalResizeStyle = this.originalElement.css( "resize" );
|
|
163
168
|
this.originalElement.css( "resize", "none" );
|
|
@@ -168,10 +173,6 @@ $.widget( "ui.resizable", $.ui.mouse, {
|
|
|
168
173
|
display: "block"
|
|
169
174
|
} ) );
|
|
170
175
|
|
|
171
|
-
// Support: IE9
|
|
172
|
-
// avoid IE jump (hard set the margin)
|
|
173
|
-
this.originalElement.css( margins );
|
|
174
|
-
|
|
175
176
|
this._proportionallyResize();
|
|
176
177
|
}
|
|
177
178
|
|
|
@@ -373,7 +374,7 @@ $.widget( "ui.resizable", $.ui.mouse, {
|
|
|
373
374
|
|
|
374
375
|
_mouseStart: function( event ) {
|
|
375
376
|
|
|
376
|
-
var curleft, curtop, cursor,
|
|
377
|
+
var curleft, curtop, cursor, calculatedSize,
|
|
377
378
|
o = this.options,
|
|
378
379
|
el = this.element;
|
|
379
380
|
|
|
@@ -392,20 +393,24 @@ $.widget( "ui.resizable", $.ui.mouse, {
|
|
|
392
393
|
this.offset = this.helper.offset();
|
|
393
394
|
this.position = { left: curleft, top: curtop };
|
|
394
395
|
|
|
396
|
+
if ( !this._helper ) {
|
|
397
|
+
calculatedSize = this._calculateAdjustedElementDimensions( el );
|
|
398
|
+
}
|
|
399
|
+
|
|
395
400
|
this.size = this._helper ? {
|
|
396
401
|
width: this.helper.width(),
|
|
397
402
|
height: this.helper.height()
|
|
398
403
|
} : {
|
|
399
|
-
width:
|
|
400
|
-
height:
|
|
404
|
+
width: calculatedSize.width,
|
|
405
|
+
height: calculatedSize.height
|
|
401
406
|
};
|
|
402
407
|
|
|
403
408
|
this.originalSize = this._helper ? {
|
|
404
409
|
width: el.outerWidth(),
|
|
405
410
|
height: el.outerHeight()
|
|
406
411
|
} : {
|
|
407
|
-
width:
|
|
408
|
-
height:
|
|
412
|
+
width: calculatedSize.width,
|
|
413
|
+
height: calculatedSize.height
|
|
409
414
|
};
|
|
410
415
|
|
|
411
416
|
this.sizeDiff = {
|
|
@@ -701,6 +706,52 @@ $.widget( "ui.resizable", $.ui.mouse, {
|
|
|
701
706
|
};
|
|
702
707
|
},
|
|
703
708
|
|
|
709
|
+
_calculateAdjustedElementDimensions: function( element ) {
|
|
710
|
+
var elWidth, elHeight, paddingBorder,
|
|
711
|
+
ce = element.get( 0 );
|
|
712
|
+
|
|
713
|
+
if ( element.css( "box-sizing" ) !== "content-box" ||
|
|
714
|
+
( !this._hasScroll( ce ) && !this._hasScroll( ce, "left" ) ) ) {
|
|
715
|
+
return {
|
|
716
|
+
height: parseFloat( element.css( "height" ) ),
|
|
717
|
+
width: parseFloat( element.css( "width" ) )
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
// Check if CSS inline styles are set and use those (usually from previous resizes)
|
|
722
|
+
elWidth = parseFloat( ce.style.width );
|
|
723
|
+
elHeight = parseFloat( ce.style.height );
|
|
724
|
+
|
|
725
|
+
paddingBorder = this._getPaddingPlusBorderDimensions( element );
|
|
726
|
+
elWidth = isNaN( elWidth ) ?
|
|
727
|
+
this._getElementTheoreticalSize( element, paddingBorder, "width" ) :
|
|
728
|
+
elWidth;
|
|
729
|
+
elHeight = isNaN( elHeight ) ?
|
|
730
|
+
this._getElementTheoreticalSize( element, paddingBorder, "height" ) :
|
|
731
|
+
elHeight;
|
|
732
|
+
|
|
733
|
+
return {
|
|
734
|
+
height: elHeight,
|
|
735
|
+
width: elWidth
|
|
736
|
+
};
|
|
737
|
+
},
|
|
738
|
+
|
|
739
|
+
_getElementTheoreticalSize: function( element, extraSize, dimension ) {
|
|
740
|
+
|
|
741
|
+
// offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
|
|
742
|
+
var size = Math.max( 0, Math.ceil(
|
|
743
|
+
element.get( 0 )[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
|
|
744
|
+
extraSize[ dimension ] -
|
|
745
|
+
0.5
|
|
746
|
+
|
|
747
|
+
// If offsetWidth/offsetHeight is unknown, then we can't determine theoretical size.
|
|
748
|
+
// Use an explicit zero to avoid NaN.
|
|
749
|
+
// See https://github.com/jquery/jquery/issues/3964
|
|
750
|
+
) ) || 0;
|
|
751
|
+
|
|
752
|
+
return size;
|
|
753
|
+
},
|
|
754
|
+
|
|
704
755
|
_proportionallyResize: function() {
|
|
705
756
|
|
|
706
757
|
if ( !this._proportionallyResizeElements.length ) {
|
|
@@ -1055,9 +1106,11 @@ $.ui.plugin.add( "resizable", "alsoResize", {
|
|
|
1055
1106
|
o = that.options;
|
|
1056
1107
|
|
|
1057
1108
|
$( o.alsoResize ).each( function() {
|
|
1058
|
-
var el = $( this )
|
|
1109
|
+
var el = $( this ),
|
|
1110
|
+
elSize = that._calculateAdjustedElementDimensions( el );
|
|
1111
|
+
|
|
1059
1112
|
el.data( "ui-resizable-alsoresize", {
|
|
1060
|
-
width:
|
|
1113
|
+
width: elSize.width, height: elSize.height,
|
|
1061
1114
|
left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) )
|
|
1062
1115
|
} );
|
|
1063
1116
|
} );
|
|
@@ -1119,7 +1172,7 @@ $.ui.plugin.add( "resizable", "ghost", {
|
|
|
1119
1172
|
|
|
1120
1173
|
// DEPRECATED
|
|
1121
1174
|
// TODO: remove after 1.12
|
|
1122
|
-
if ( $.uiBackCompat
|
|
1175
|
+
if ( $.uiBackCompat === true && typeof that.options.ghost === "string" ) {
|
|
1123
1176
|
|
|
1124
1177
|
// Ghost option
|
|
1125
1178
|
that.ghost.addClass( this.options.ghost );
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
//= require jquery-ui/widgets/mouse
|
|
2
2
|
//= require jquery-ui/data
|
|
3
|
-
//= require jquery-ui/ie
|
|
4
3
|
//= require jquery-ui/scroll-parent
|
|
5
4
|
//= require jquery-ui/version
|
|
6
5
|
//= require jquery-ui/widget
|
|
7
6
|
|
|
8
7
|
/*!
|
|
9
|
-
* jQuery UI Sortable 1.
|
|
8
|
+
* jQuery UI Sortable 1.14.2
|
|
10
9
|
* https://jqueryui.com
|
|
11
10
|
*
|
|
12
11
|
* Copyright OpenJS Foundation and other contributors
|
|
@@ -31,7 +30,6 @@
|
|
|
31
30
|
"jquery",
|
|
32
31
|
"./mouse",
|
|
33
32
|
"../data",
|
|
34
|
-
"../ie",
|
|
35
33
|
"../scroll-parent",
|
|
36
34
|
"../version",
|
|
37
35
|
"../widget"
|
|
@@ -45,7 +43,7 @@
|
|
|
45
43
|
"use strict";
|
|
46
44
|
|
|
47
45
|
return $.widget( "ui.sortable", $.ui.mouse, {
|
|
48
|
-
version: "1.
|
|
46
|
+
version: "1.14.2",
|
|
49
47
|
widgetEventPrefix: "sort",
|
|
50
48
|
ready: false,
|
|
51
49
|
options: {
|
|
@@ -283,11 +281,7 @@ return $.widget( "ui.sortable", $.ui.mouse, {
|
|
|
283
281
|
if ( o.cursor && o.cursor !== "auto" ) { // cursor option
|
|
284
282
|
body = this.document.find( "body" );
|
|
285
283
|
|
|
286
|
-
|
|
287
|
-
this.storedCursor = body.css( "cursor" );
|
|
288
|
-
body.css( "cursor", o.cursor );
|
|
289
|
-
|
|
290
|
-
this.storedStylesheet =
|
|
284
|
+
this._storedStylesheet =
|
|
291
285
|
$( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body );
|
|
292
286
|
}
|
|
293
287
|
|
|
@@ -1204,11 +1198,9 @@ return $.widget( "ui.sortable", $.ui.mouse, {
|
|
|
1204
1198
|
po.top += this.scrollParent.scrollTop();
|
|
1205
1199
|
}
|
|
1206
1200
|
|
|
1207
|
-
// This needs to be actually done for all browsers, since pageX/pageY includes
|
|
1208
|
-
// information
|
|
1209
|
-
if ( this.offsetParent[ 0 ] === this.document[ 0 ].body
|
|
1210
|
-
( this.offsetParent[ 0 ].tagName &&
|
|
1211
|
-
this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) {
|
|
1201
|
+
// This needs to be actually done for all browsers, since pageX/pageY includes
|
|
1202
|
+
// this information.
|
|
1203
|
+
if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ) {
|
|
1212
1204
|
po = { top: 0, left: 0 };
|
|
1213
1205
|
}
|
|
1214
1206
|
|
|
@@ -1556,9 +1548,9 @@ return $.widget( "ui.sortable", $.ui.mouse, {
|
|
|
1556
1548
|
}
|
|
1557
1549
|
|
|
1558
1550
|
//Do what was originally in plugins
|
|
1559
|
-
if ( this.
|
|
1560
|
-
this.
|
|
1561
|
-
this.
|
|
1551
|
+
if ( this._storedStylesheet ) {
|
|
1552
|
+
this._storedStylesheet.remove();
|
|
1553
|
+
this._storedStylesheet = null;
|
|
1562
1554
|
}
|
|
1563
1555
|
if ( this._storedOpacity ) {
|
|
1564
1556
|
this.helper.css( "opacity", this._storedOpacity );
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
//= require jquery-ui/keycode
|
|
2
|
-
//= require jquery-ui/safe-active-element
|
|
3
2
|
//= require jquery-ui/unique-id
|
|
4
3
|
//= require jquery-ui/version
|
|
5
4
|
//= require jquery-ui/widget
|
|
6
5
|
|
|
7
6
|
/*!
|
|
8
|
-
* jQuery UI Tabs 1.
|
|
7
|
+
* jQuery UI Tabs 1.14.2
|
|
9
8
|
* https://jqueryui.com
|
|
10
9
|
*
|
|
11
10
|
* Copyright OpenJS Foundation and other contributors
|
|
@@ -31,7 +30,6 @@
|
|
|
31
30
|
define( [
|
|
32
31
|
"jquery",
|
|
33
32
|
"../keycode",
|
|
34
|
-
"../safe-active-element",
|
|
35
33
|
"../unique-id",
|
|
36
34
|
"../version",
|
|
37
35
|
"../widget"
|
|
@@ -45,7 +43,7 @@
|
|
|
45
43
|
"use strict";
|
|
46
44
|
|
|
47
45
|
$.widget( "ui.tabs", {
|
|
48
|
-
version: "1.
|
|
46
|
+
version: "1.14.2",
|
|
49
47
|
delay: 300,
|
|
50
48
|
options: {
|
|
51
49
|
active: null,
|
|
@@ -68,26 +66,19 @@ $.widget( "ui.tabs", {
|
|
|
68
66
|
load: null
|
|
69
67
|
},
|
|
70
68
|
|
|
71
|
-
_isLocal: (
|
|
72
|
-
var
|
|
69
|
+
_isLocal: function( anchor ) {
|
|
70
|
+
var anchorUrl = new URL( anchor.href ),
|
|
71
|
+
locationUrl = new URL( location.href );
|
|
73
72
|
|
|
74
|
-
return
|
|
75
|
-
var anchorUrl, locationUrl;
|
|
73
|
+
return anchor.hash.length > 1 &&
|
|
76
74
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
try {
|
|
85
|
-
locationUrl = decodeURIComponent( locationUrl );
|
|
86
|
-
} catch ( error ) {}
|
|
87
|
-
|
|
88
|
-
return anchor.hash.length > 1 && anchorUrl === locationUrl;
|
|
89
|
-
};
|
|
90
|
-
} )(),
|
|
75
|
+
// `href` may contain a hash but also username & password;
|
|
76
|
+
// we want to ignore them, so we check the three fields
|
|
77
|
+
// below instead.
|
|
78
|
+
anchorUrl.origin === locationUrl.origin &&
|
|
79
|
+
anchorUrl.pathname === locationUrl.pathname &&
|
|
80
|
+
anchorUrl.search === locationUrl.search;
|
|
81
|
+
},
|
|
91
82
|
|
|
92
83
|
_create: function() {
|
|
93
84
|
var that = this,
|
|
@@ -128,7 +119,8 @@ $.widget( "ui.tabs", {
|
|
|
128
119
|
_initialActive: function() {
|
|
129
120
|
var active = this.options.active,
|
|
130
121
|
collapsible = this.options.collapsible,
|
|
131
|
-
locationHash = location.hash.substring( 1 )
|
|
122
|
+
locationHash = location.hash.substring( 1 ),
|
|
123
|
+
locationHashDecoded = decodeURIComponent( locationHash );
|
|
132
124
|
|
|
133
125
|
if ( active === null ) {
|
|
134
126
|
|
|
@@ -140,6 +132,18 @@ $.widget( "ui.tabs", {
|
|
|
140
132
|
return false;
|
|
141
133
|
}
|
|
142
134
|
} );
|
|
135
|
+
|
|
136
|
+
// If not found, decode the hash & try again.
|
|
137
|
+
// See the comment in `_processTabs` under the `_isLocal` check
|
|
138
|
+
// for more information.
|
|
139
|
+
if ( active === null ) {
|
|
140
|
+
this.tabs.each( function( i, tab ) {
|
|
141
|
+
if ( $( tab ).attr( "aria-controls" ) === locationHashDecoded ) {
|
|
142
|
+
active = i;
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
} );
|
|
146
|
+
}
|
|
143
147
|
}
|
|
144
148
|
|
|
145
149
|
// Check for a tab marked active via a class
|
|
@@ -177,7 +181,7 @@ $.widget( "ui.tabs", {
|
|
|
177
181
|
},
|
|
178
182
|
|
|
179
183
|
_tabKeydown: function( event ) {
|
|
180
|
-
var focusedTab = $(
|
|
184
|
+
var focusedTab = $( this.document[ 0 ].activeElement ).closest( "li" ),
|
|
181
185
|
selectedIndex = this.tabs.index( focusedTab ),
|
|
182
186
|
goingForward = true;
|
|
183
187
|
|
|
@@ -319,10 +323,6 @@ $.widget( "ui.tabs", {
|
|
|
319
323
|
}
|
|
320
324
|
},
|
|
321
325
|
|
|
322
|
-
_sanitizeSelector: function( hash ) {
|
|
323
|
-
return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
|
|
324
|
-
},
|
|
325
|
-
|
|
326
326
|
refresh: function() {
|
|
327
327
|
var options = this.options,
|
|
328
328
|
lis = this.tablist.children( ":has(a[href])" );
|
|
@@ -414,18 +414,6 @@ $.widget( "ui.tabs", {
|
|
|
414
414
|
if ( $( this ).is( ".ui-state-disabled" ) ) {
|
|
415
415
|
event.preventDefault();
|
|
416
416
|
}
|
|
417
|
-
} )
|
|
418
|
-
|
|
419
|
-
// Support: IE <9
|
|
420
|
-
// Preventing the default action in mousedown doesn't prevent IE
|
|
421
|
-
// from focusing the element, so if the anchor gets focused, blur.
|
|
422
|
-
// We don't have to worry about focusing the previously focused
|
|
423
|
-
// element since clicking on a non-focusable element should focus
|
|
424
|
-
// the body anyway.
|
|
425
|
-
.on( "focus" + this.eventNamespace, ".ui-tabs-anchor", function() {
|
|
426
|
-
if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
|
|
427
|
-
this.blur();
|
|
428
|
-
}
|
|
429
417
|
} );
|
|
430
418
|
|
|
431
419
|
this.tabs = this.tablist.find( "> li:has(a[href])" )
|
|
@@ -453,9 +441,24 @@ $.widget( "ui.tabs", {
|
|
|
453
441
|
|
|
454
442
|
// Inline tab
|
|
455
443
|
if ( that._isLocal( anchor ) ) {
|
|
444
|
+
|
|
445
|
+
// The "scrolling to a fragment" section of the HTML spec:
|
|
446
|
+
// https://html.spec.whatwg.org/#scrolling-to-a-fragment
|
|
447
|
+
// uses a concept of document's indicated part:
|
|
448
|
+
// https://html.spec.whatwg.org/#the-indicated-part-of-the-document
|
|
449
|
+
// Slightly below there's an algorithm to compute the indicated
|
|
450
|
+
// part:
|
|
451
|
+
// https://html.spec.whatwg.org/#the-indicated-part-of-the-document
|
|
452
|
+
// First, the algorithm tries the hash as-is, without decoding.
|
|
453
|
+
// Then, if one is not found, the same is attempted with a decoded
|
|
454
|
+
// hash. Replicate this logic.
|
|
456
455
|
selector = anchor.hash;
|
|
457
456
|
panelId = selector.substring( 1 );
|
|
458
|
-
panel = that.element.find(
|
|
457
|
+
panel = that.element.find( "#" + CSS.escape( panelId ) );
|
|
458
|
+
if ( !panel.length ) {
|
|
459
|
+
panelId = decodeURIComponent( panelId );
|
|
460
|
+
panel = that.element.find( "#" + CSS.escape( panelId ) );
|
|
461
|
+
}
|
|
459
462
|
|
|
460
463
|
// remote tab
|
|
461
464
|
} else {
|
|
@@ -741,7 +744,7 @@ $.widget( "ui.tabs", {
|
|
|
741
744
|
// meta-function to give users option to provide a href string instead of a numerical index.
|
|
742
745
|
if ( typeof index === "string" ) {
|
|
743
746
|
index = this.anchors.index( this.anchors.filter( "[href$='" +
|
|
744
|
-
|
|
747
|
+
CSS.escape( index ) + "']" ) );
|
|
745
748
|
}
|
|
746
749
|
|
|
747
750
|
return index;
|
|
@@ -863,32 +866,19 @@ $.widget( "ui.tabs", {
|
|
|
863
866
|
|
|
864
867
|
this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
|
|
865
868
|
|
|
866
|
-
|
|
867
|
-
// jQuery <1.8 returns false if the request is canceled in beforeSend,
|
|
868
|
-
// but as of 1.8, $.ajax() always returns a jqXHR object.
|
|
869
|
-
if ( this.xhr && this.xhr.statusText !== "canceled" ) {
|
|
869
|
+
if ( this.xhr.statusText !== "canceled" ) {
|
|
870
870
|
this._addClass( tab, "ui-tabs-loading" );
|
|
871
871
|
panel.attr( "aria-busy", "true" );
|
|
872
872
|
|
|
873
873
|
this.xhr
|
|
874
874
|
.done( function( response, status, jqXHR ) {
|
|
875
|
+
panel.html( response );
|
|
876
|
+
that._trigger( "load", event, eventData );
|
|
875
877
|
|
|
876
|
-
|
|
877
|
-
// https://bugs.jquery.com/ticket/11778
|
|
878
|
-
setTimeout( function() {
|
|
879
|
-
panel.html( response );
|
|
880
|
-
that._trigger( "load", event, eventData );
|
|
881
|
-
|
|
882
|
-
complete( jqXHR, status );
|
|
883
|
-
}, 1 );
|
|
878
|
+
complete( jqXHR, status );
|
|
884
879
|
} )
|
|
885
880
|
.fail( function( jqXHR, status ) {
|
|
886
|
-
|
|
887
|
-
// support: jQuery <1.8
|
|
888
|
-
// https://bugs.jquery.com/ticket/11778
|
|
889
|
-
setTimeout( function() {
|
|
890
|
-
complete( jqXHR, status );
|
|
891
|
-
}, 1 );
|
|
881
|
+
complete( jqXHR, status );
|
|
892
882
|
} );
|
|
893
883
|
}
|
|
894
884
|
},
|
|
@@ -896,10 +886,7 @@ $.widget( "ui.tabs", {
|
|
|
896
886
|
_ajaxSettings: function( anchor, event, eventData ) {
|
|
897
887
|
var that = this;
|
|
898
888
|
return {
|
|
899
|
-
|
|
900
|
-
// Support: IE <11 only
|
|
901
|
-
// Strip any hash that exists to prevent errors with the Ajax request
|
|
902
|
-
url: anchor.attr( "href" ).replace( /#.*$/, "" ),
|
|
889
|
+
url: anchor.attr( "href" ),
|
|
903
890
|
beforeSend: function( jqXHR, settings ) {
|
|
904
891
|
return that._trigger( "beforeLoad", event,
|
|
905
892
|
$.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
|
|
@@ -909,13 +896,13 @@ $.widget( "ui.tabs", {
|
|
|
909
896
|
|
|
910
897
|
_getPanelForTab: function( tab ) {
|
|
911
898
|
var id = $( tab ).attr( "aria-controls" );
|
|
912
|
-
return this.element.find(
|
|
899
|
+
return this.element.find( "#" + CSS.escape( id ) );
|
|
913
900
|
}
|
|
914
901
|
} );
|
|
915
902
|
|
|
916
903
|
// DEPRECATED
|
|
917
904
|
// TODO: Switch return back to widget declaration at top of file when this is removed
|
|
918
|
-
if ( $.uiBackCompat
|
|
905
|
+
if ( $.uiBackCompat === true ) {
|
|
919
906
|
|
|
920
907
|
// Backcompat for ui-tab class (now ui-tabs-tab)
|
|
921
908
|
$.widget( "ui.tabs", $.ui.tabs, {
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activeadmin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Charles Maresh
|
|
@@ -482,14 +482,10 @@ files:
|
|
|
482
482
|
- vendor/assets/javascripts/jquery-ui/disable-selection.js
|
|
483
483
|
- vendor/assets/javascripts/jquery-ui/focusable.js
|
|
484
484
|
- vendor/assets/javascripts/jquery-ui/form-reset-mixin.js
|
|
485
|
-
- vendor/assets/javascripts/jquery-ui/form.js
|
|
486
|
-
- vendor/assets/javascripts/jquery-ui/ie.js
|
|
487
485
|
- vendor/assets/javascripts/jquery-ui/keycode.js
|
|
488
486
|
- vendor/assets/javascripts/jquery-ui/labels.js
|
|
489
487
|
- vendor/assets/javascripts/jquery-ui/plugin.js
|
|
490
488
|
- vendor/assets/javascripts/jquery-ui/position.js
|
|
491
|
-
- vendor/assets/javascripts/jquery-ui/safe-active-element.js
|
|
492
|
-
- vendor/assets/javascripts/jquery-ui/safe-blur.js
|
|
493
489
|
- vendor/assets/javascripts/jquery-ui/scroll-parent.js
|
|
494
490
|
- vendor/assets/javascripts/jquery-ui/tabbable.js
|
|
495
491
|
- vendor/assets/javascripts/jquery-ui/unique-id.js
|
|
@@ -524,7 +520,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
524
520
|
requirements:
|
|
525
521
|
- - ">="
|
|
526
522
|
- !ruby/object:Gem::Version
|
|
527
|
-
version: '
|
|
523
|
+
version: '3.0'
|
|
528
524
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
529
525
|
requirements:
|
|
530
526
|
- - ">="
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//= require jquery-ui/version
|
|
2
|
-
|
|
3
|
-
( function( factory ) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
if ( typeof define === "function" && define.amd ) {
|
|
7
|
-
|
|
8
|
-
// AMD. Register as an anonymous module.
|
|
9
|
-
define( [ "jquery", "./version" ], factory );
|
|
10
|
-
} else {
|
|
11
|
-
|
|
12
|
-
// Browser globals
|
|
13
|
-
factory( jQuery );
|
|
14
|
-
}
|
|
15
|
-
} )( function( $ ) {
|
|
16
|
-
"use strict";
|
|
17
|
-
|
|
18
|
-
// Support: IE8 Only
|
|
19
|
-
// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop
|
|
20
|
-
// with a string, so we need to find the proper form.
|
|
21
|
-
return $.fn._form = function() {
|
|
22
|
-
return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form );
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
} );
|