activeadmin 3.2.1 → 3.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/README.md +2 -2
- data/app/assets/stylesheets/active_admin/_forms.scss +1 -2
- data/app/assets/stylesheets/active_admin/components/_comments.scss +1 -1
- data/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss +7 -4
- data/app/assets/stylesheets/active_admin/components/_pagination.scss +5 -2
- data/app/assets/stylesheets/active_admin/components/_table_tools.scss +9 -6
- data/app/assets/stylesheets/active_admin/components/_tabs.scss +10 -7
- data/app/assets/stylesheets/active_admin/mixins/_buttons.scss +2 -2
- data/app/assets/stylesheets/active_admin/pages/_logged_out.scss +1 -1
- data/app/assets/stylesheets/active_admin/structure/_footer.scss +1 -1
- data/app/assets/stylesheets/active_admin/structure/_title_bar.scss +6 -3
- data/lib/active_admin/pundit_adapter.rb +1 -1
- data/lib/active_admin/resource/attributes.rb +8 -1
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/views/components/active_admin_form.rb +1 -1
- data/vendor/assets/javascripts/jquery-ui/data.js +12 -8
- data/vendor/assets/javascripts/jquery-ui/disable-selection.js +10 -7
- data/vendor/assets/javascripts/jquery-ui/focusable.js +12 -9
- data/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js +60 -57
- data/vendor/assets/javascripts/jquery-ui/form.js +15 -12
- data/vendor/assets/javascripts/jquery-ui/ie.js +5 -2
- data/vendor/assets/javascripts/jquery-ui/keycode.js +11 -7
- data/vendor/assets/javascripts/jquery-ui/labels.js +46 -40
- data/vendor/assets/javascripts/jquery-ui/plugin.js +5 -2
- data/vendor/assets/javascripts/jquery-ui/position.js +30 -17
- data/vendor/assets/javascripts/jquery-ui/safe-active-element.js +6 -2
- data/vendor/assets/javascripts/jquery-ui/safe-blur.js +6 -2
- data/vendor/assets/javascripts/jquery-ui/scroll-parent.js +10 -7
- data/vendor/assets/javascripts/jquery-ui/tabbable.js +11 -8
- data/vendor/assets/javascripts/jquery-ui/unique-id.js +10 -7
- data/vendor/assets/javascripts/jquery-ui/version.js +6 -3
- data/vendor/assets/javascripts/jquery-ui/widget.js +53 -30
- data/vendor/assets/javascripts/jquery-ui/widgets/button.js +87 -24
- data/vendor/assets/javascripts/jquery-ui/widgets/checkboxradio.js +276 -273
- data/vendor/assets/javascripts/jquery-ui/widgets/controlgroup.js +15 -11
- data/vendor/assets/javascripts/jquery-ui/widgets/datepicker.js +182 -62
- data/vendor/assets/javascripts/jquery-ui/widgets/dialog.js +53 -36
- data/vendor/assets/javascripts/jquery-ui/widgets/draggable.js +28 -19
- data/vendor/assets/javascripts/jquery-ui/widgets/mouse.js +22 -11
- data/vendor/assets/javascripts/jquery-ui/widgets/resizable.js +47 -26
- data/vendor/assets/javascripts/jquery-ui/widgets/sortable.js +186 -125
- data/vendor/assets/javascripts/jquery-ui/widgets/tabs.js +20 -20
- metadata +3 -4
- data/vendor/assets/javascripts/jquery-ui/escape-selector.js +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd51d7cc81eac3cbb01358076ca98368ccd5879f96dd9dfaed3f4e6b5c511648
|
4
|
+
data.tar.gz: 95913536dfd3ccf746a0848545b81685ead621cd2536776ede879a9b02196058
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b296e6597a76172815063ca7b63ba359308b9a13c26874b6ea6b746dbd25bb8d6929c4da2f1b8682dfbd998cc7a752c73d2eca70b356fdfad8362294273aac9
|
7
|
+
data.tar.gz: ac965d5a5b2308a064e0e47816c1739f8482570ce926feb72fcf1031b12ac1e738719571faae48d03128c1d8af790e74e47c04e7f62484e791cd654749373417
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,27 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 3.2.3 [☰](https://github.com/activeadmin/activeadmin/compare/v3.2.2..v3.2.3)
|
6
|
+
|
7
|
+
### Enhancements
|
8
|
+
|
9
|
+
* Backport better implementation of counter-cache-column check [#8412] by [@plashchynski]
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* Remove deprecation warnings when building with dart sass >= 1.77.7 [#8405] by [@mgrunberg]
|
14
|
+
|
15
|
+
## 3.2.2 [☰](https://github.com/activeadmin/activeadmin/compare/v3.2.1..v3.2.2)
|
16
|
+
|
17
|
+
### Security Fixes
|
18
|
+
|
19
|
+
* Backport Fix potential XSS issue when rendering form legends [#8349] by
|
20
|
+
[@deivid-rodriguez]
|
21
|
+
|
22
|
+
### Enhancements
|
23
|
+
|
24
|
+
* Update vendored jQuery UI to 1.13.3 [#8329] by [@tagliala]
|
25
|
+
|
5
26
|
## 3.2.1 [☰](https://github.com/activeadmin/activeadmin/compare/v3.2.0..v3.2.1)
|
6
27
|
|
7
28
|
### Enhancements
|
@@ -907,6 +928,10 @@ Please check [0-6-stable] for previous changes.
|
|
907
928
|
[#8167]: https://github.com/activeadmin/activeadmin/pull/8167
|
908
929
|
[#8310]: https://github.com/activeadmin/activeadmin/pull/8310
|
909
930
|
[#8311]: https://github.com/activeadmin/activeadmin/pull/8311
|
931
|
+
[#8329]: https://github.com/activeadmin/activeadmin/pull/8329
|
932
|
+
[#8349]: https://github.com/activeadmin/activeadmin/pull/8349
|
933
|
+
[#8405]: https://github.com/activeadmin/activeadmin/pull/8405
|
934
|
+
[#8412]: https://github.com/activeadmin/activeadmin/pull/8412
|
910
935
|
|
911
936
|
[@1000ship]: https://github.com/1000ship
|
912
937
|
[@5t111111]: https://github.com/5t111111
|
@@ -1001,6 +1026,7 @@ Please check [0-6-stable] for previous changes.
|
|
1001
1026
|
[@orkhan]: https://github.com/orkhan
|
1002
1027
|
[@panasyuk]: https://github.com/panasyuk
|
1003
1028
|
[@PChambino]: https://github.com/PChambino
|
1029
|
+
[@plashchynski]: https://github.com/plashchynski
|
1004
1030
|
[@potatosalad]: https://github.com/potatosalad
|
1005
1031
|
[@pranas]: https://github.com/pranas
|
1006
1032
|
[@ray-curran]: https://github.com/ray-curran
|
data/README.md
CHANGED
@@ -85,8 +85,8 @@ Thanks to [Tidelift][tidelift] and all our Tidelift subscribers.
|
|
85
85
|
Thanks to [Open Collective][opencollective contributors] and all our Open Collective contributors.
|
86
86
|
|
87
87
|
[Arbre]: https://github.com/activeadmin/arbre
|
88
|
-
[Devise]: https://github.com/
|
89
|
-
[Formtastic]: https://github.com/
|
88
|
+
[Devise]: https://github.com/heartcombo/devise
|
89
|
+
[Formtastic]: https://github.com/formtastic/formtastic
|
90
90
|
[Inherited Resources]: https://github.com/activeadmin/inherited_resources
|
91
91
|
[Kaminari]: https://github.com/kaminari/kaminari
|
92
92
|
[Ransack]: https://github.com/activerecord-hackery/ransack
|
@@ -3,9 +3,12 @@
|
|
3
3
|
|
4
4
|
.dropdown_menu_button {
|
5
5
|
@include light-button;
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
|
7
|
+
& {
|
8
|
+
position: relative;
|
9
|
+
padding-right: 22px !important;
|
10
|
+
cursor: pointer;
|
11
|
+
}
|
9
12
|
|
10
13
|
&:before {
|
11
14
|
content: ' ';
|
@@ -139,11 +142,11 @@
|
|
139
142
|
}
|
140
143
|
|
141
144
|
&:last-child {
|
145
|
+
border: none;
|
142
146
|
a {
|
143
147
|
border-bottom-left-radius: 2px;
|
144
148
|
border-bottom-right-radius: 2px;
|
145
149
|
}
|
146
|
-
border: none;
|
147
150
|
}
|
148
151
|
}
|
149
152
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.table_tools {
|
2
|
-
@include clearfix;
|
3
2
|
margin-bottom: 16px;
|
3
|
+
@include clearfix;
|
4
4
|
}
|
5
5
|
|
6
6
|
.table_tools .dropdown_menu {
|
@@ -9,11 +9,14 @@
|
|
9
9
|
|
10
10
|
a.table_tools_button, .table_tools .dropdown_menu_button {
|
11
11
|
@include light-button;
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
|
13
|
+
& {
|
14
|
+
@include gradient(#FFFFFF, #F0F0F0);
|
15
|
+
@include border-colors(#d9d9d9, #d0d0d0, #c5c5c5);
|
16
|
+
font-size: 0.9em;
|
17
|
+
padding: 4px 14px 4px;
|
18
|
+
margin: 0;
|
19
|
+
}
|
17
20
|
|
18
21
|
&:not(.disabled) {
|
19
22
|
&:hover {
|
@@ -28,13 +28,16 @@
|
|
28
28
|
|
29
29
|
a {
|
30
30
|
@include light-button;
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
|
32
|
+
& {
|
33
|
+
@include gradient(#FFFFFF, #F0F0F0);
|
34
|
+
@include border-colors(#d9d9d9, #d0d0d0, #c5c5c5);
|
35
|
+
text-decoration: none;
|
36
|
+
border-radius: 0;
|
37
|
+
border-width: 1px .5px 1px .5px;
|
38
|
+
margin-right: 0;
|
39
|
+
padding: 4px 14px 4px;
|
40
|
+
}
|
38
41
|
|
39
42
|
&:not(.disabled) {
|
40
43
|
&:hover {
|
@@ -17,13 +17,13 @@
|
|
17
17
|
}
|
18
18
|
|
19
19
|
@mixin default-button {
|
20
|
-
@include basic-button;
|
21
20
|
@include gradient(lighten($primary-color, 15%), darken($primary-color, 12%));
|
22
21
|
@include text-shadow(#000);
|
23
22
|
box-shadow: 0 1px 1px rgba(0,0,0,0.10), 0 1px 0 0px rgba(255,255,255, 0.2) inset;
|
24
23
|
border: solid 1px #484e53;
|
25
24
|
@include border-colors(#616a71, #484e53, #363b3f);
|
26
25
|
color: #efefef;
|
26
|
+
@include basic-button;
|
27
27
|
|
28
28
|
&:not(.disabled) {
|
29
29
|
&:hover{
|
@@ -38,13 +38,13 @@
|
|
38
38
|
}
|
39
39
|
|
40
40
|
@mixin light-button {
|
41
|
-
@include basic-button;
|
42
41
|
@include gradient(#FFFFFF, #E7E7E7);
|
43
42
|
box-shadow: 0 1px 1px rgba(0,0,0,0.10), 0 1px 0 0 rgba(255,255,255, 0.8) inset;
|
44
43
|
border: solid 1px #c7c7c7;
|
45
44
|
@include border-colors(#d3d3d3, #c7c7c7, #c2c2c2);
|
46
45
|
@include text-shadow;
|
47
46
|
color: $primary-color;
|
47
|
+
@include basic-button;
|
48
48
|
|
49
49
|
&:not(.disabled) {
|
50
50
|
&:hover {
|
@@ -28,13 +28,13 @@ body.logged_out {
|
|
28
28
|
@include no-shadow;
|
29
29
|
background: none;
|
30
30
|
padding: 0;
|
31
|
+
margin-bottom: 0;
|
31
32
|
li { padding: 10px 0; }
|
32
33
|
|
33
34
|
input[type=text], input[type=email], input[type=password] {
|
34
35
|
width: 70%;
|
35
36
|
}
|
36
37
|
&.buttons { margin-left: 20%; }
|
37
|
-
margin-bottom: 0;
|
38
38
|
}
|
39
39
|
}
|
40
40
|
|
@@ -1,6 +1,5 @@
|
|
1
1
|
#title_bar {
|
2
2
|
@include section-header;
|
3
|
-
@include clearfix;
|
4
3
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.37);
|
5
4
|
display: table;
|
6
5
|
border-bottom-color: #EEE;
|
@@ -9,6 +8,7 @@
|
|
9
8
|
margin: 0;
|
10
9
|
padding: 10px $horizontal-page-margin;
|
11
10
|
z-index: 800;
|
11
|
+
@include clearfix;
|
12
12
|
|
13
13
|
#titlebar_left, #titlebar_right {
|
14
14
|
height: 50px;
|
@@ -32,8 +32,11 @@
|
|
32
32
|
span.action_item {
|
33
33
|
& > a, & > .dropdown_menu > a {
|
34
34
|
@include light-button;
|
35
|
-
|
36
|
-
|
35
|
+
|
36
|
+
& {
|
37
|
+
padding: 12px 17px 10px;
|
38
|
+
margin: 0px;
|
39
|
+
}
|
37
40
|
}
|
38
41
|
}
|
39
42
|
}
|
@@ -42,7 +42,7 @@ module ActiveAdmin
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def format_action(action, subject)
|
45
|
-
# https://github.com/varvet/pundit/blob/
|
45
|
+
# https://github.com/varvet/pundit/blob/main/lib/generators/pundit/install/templates/application_policy.rb
|
46
46
|
case action
|
47
47
|
when Auth::READ then subject.is_a?(Class) ? :index? : :show?
|
48
48
|
when Auth::DESTROY then subject.is_a?(Class) ? :destroy_all? : :destroy?
|
@@ -37,7 +37,14 @@ module ActiveAdmin
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def counter_cache_col?(c)
|
40
|
-
|
40
|
+
# This helper is called inside a loop. Let's memoize the result.
|
41
|
+
@counter_cache_columns ||= begin
|
42
|
+
resource_class.reflect_on_all_associations(:has_many)
|
43
|
+
.select(&:has_cached_counter?)
|
44
|
+
.map(&:counter_cache_column)
|
45
|
+
end
|
46
|
+
|
47
|
+
@counter_cache_columns.include?(c.name)
|
41
48
|
end
|
42
49
|
|
43
50
|
def filtered_col?(c)
|
data/lib/active_admin/version.rb
CHANGED
@@ -127,7 +127,7 @@ module ActiveAdmin
|
|
127
127
|
html_options[:class] ||= "inputs"
|
128
128
|
legend = args.shift if args.first.is_a?(::String)
|
129
129
|
legend = html_options.delete(:name) if html_options.key?(:name)
|
130
|
-
legend_tag = legend ? "<legend><span>#{legend}</span></legend>" : ""
|
130
|
+
legend_tag = legend ? "<legend><span>#{ERB::Util.html_escape(legend)}</span></legend>" : ""
|
131
131
|
fieldset_attrs = html_options.map { |k, v| %Q{#{k}="#{v}"} }.join(" ")
|
132
132
|
@opening_tag = "<fieldset #{fieldset_attrs}>#{legend_tag}<ol>"
|
133
133
|
@closing_tag = "</ol></fieldset>"
|
@@ -1,20 +1,22 @@
|
|
1
1
|
//= require jquery-ui/version
|
2
2
|
|
3
3
|
/*!
|
4
|
-
* jQuery UI :data 1.
|
5
|
-
*
|
4
|
+
* jQuery UI :data 1.13.3
|
5
|
+
* https://jqueryui.com
|
6
6
|
*
|
7
|
-
* Copyright
|
7
|
+
* Copyright OpenJS Foundation and other contributors
|
8
8
|
* Released under the MIT license.
|
9
|
-
*
|
9
|
+
* https://jquery.org/license
|
10
10
|
*/
|
11
11
|
|
12
12
|
//>>label: :data Selector
|
13
13
|
//>>group: Core
|
14
14
|
//>>description: Selects elements which have data stored under the specified key.
|
15
|
-
//>>docs:
|
15
|
+
//>>docs: https://api.jqueryui.com/data-selector/
|
16
16
|
|
17
17
|
( function( factory ) {
|
18
|
+
"use strict";
|
19
|
+
|
18
20
|
if ( typeof define === "function" && define.amd ) {
|
19
21
|
|
20
22
|
// AMD. Register as an anonymous module.
|
@@ -24,8 +26,10 @@
|
|
24
26
|
// Browser globals
|
25
27
|
factory( jQuery );
|
26
28
|
}
|
27
|
-
} ( function( $ ) {
|
28
|
-
|
29
|
+
} )( function( $ ) {
|
30
|
+
"use strict";
|
31
|
+
|
32
|
+
return $.extend( $.expr.pseudos, {
|
29
33
|
data: $.expr.createPseudo ?
|
30
34
|
$.expr.createPseudo( function( dataName ) {
|
31
35
|
return function( elem ) {
|
@@ -38,4 +42,4 @@ return $.extend( $.expr[ ":" ], {
|
|
38
42
|
return !!$.data( elem, match[ 3 ] );
|
39
43
|
}
|
40
44
|
} );
|
41
|
-
} )
|
45
|
+
} );
|
@@ -1,21 +1,23 @@
|
|
1
1
|
//= require jquery-ui/version
|
2
2
|
|
3
3
|
/*!
|
4
|
-
* jQuery UI Disable Selection 1.
|
5
|
-
*
|
4
|
+
* jQuery UI Disable Selection 1.13.3
|
5
|
+
* https://jqueryui.com
|
6
6
|
*
|
7
|
-
* Copyright
|
7
|
+
* Copyright OpenJS Foundation and other contributors
|
8
8
|
* Released under the MIT license.
|
9
|
-
*
|
9
|
+
* https://jquery.org/license
|
10
10
|
*/
|
11
11
|
|
12
12
|
//>>label: disableSelection
|
13
13
|
//>>group: Core
|
14
14
|
//>>description: Disable selection of text content within the set of matched elements.
|
15
|
-
//>>docs:
|
15
|
+
//>>docs: https://api.jqueryui.com/disableSelection/
|
16
16
|
|
17
17
|
// This file is deprecated
|
18
18
|
( function( factory ) {
|
19
|
+
"use strict";
|
20
|
+
|
19
21
|
if ( typeof define === "function" && define.amd ) {
|
20
22
|
|
21
23
|
// AMD. Register as an anonymous module.
|
@@ -25,7 +27,8 @@
|
|
25
27
|
// Browser globals
|
26
28
|
factory( jQuery );
|
27
29
|
}
|
28
|
-
} ( function( $ ) {
|
30
|
+
} )( function( $ ) {
|
31
|
+
"use strict";
|
29
32
|
|
30
33
|
return $.fn.extend( {
|
31
34
|
disableSelection: ( function() {
|
@@ -45,4 +48,4 @@ return $.fn.extend( {
|
|
45
48
|
}
|
46
49
|
} );
|
47
50
|
|
48
|
-
} )
|
51
|
+
} );
|
@@ -1,20 +1,22 @@
|
|
1
1
|
//= require jquery-ui/version
|
2
2
|
|
3
3
|
/*!
|
4
|
-
* jQuery UI Focusable 1.
|
5
|
-
*
|
4
|
+
* jQuery UI Focusable 1.13.3
|
5
|
+
* https://jqueryui.com
|
6
6
|
*
|
7
|
-
* Copyright
|
7
|
+
* Copyright OpenJS Foundation and other contributors
|
8
8
|
* Released under the MIT license.
|
9
|
-
*
|
9
|
+
* https://jquery.org/license
|
10
10
|
*/
|
11
11
|
|
12
12
|
//>>label: :focusable Selector
|
13
13
|
//>>group: Core
|
14
14
|
//>>description: Selects elements which can be focused.
|
15
|
-
//>>docs:
|
15
|
+
//>>docs: https://api.jqueryui.com/focusable-selector/
|
16
16
|
|
17
17
|
( function( factory ) {
|
18
|
+
"use strict";
|
19
|
+
|
18
20
|
if ( typeof define === "function" && define.amd ) {
|
19
21
|
|
20
22
|
// AMD. Register as an anonymous module.
|
@@ -24,7 +26,8 @@
|
|
24
26
|
// Browser globals
|
25
27
|
factory( jQuery );
|
26
28
|
}
|
27
|
-
} ( function( $ ) {
|
29
|
+
} )( function( $ ) {
|
30
|
+
"use strict";
|
28
31
|
|
29
32
|
// Selectors
|
30
33
|
$.ui.focusable = function( element, hasTabindex ) {
|
@@ -72,10 +75,10 @@ function visible( element ) {
|
|
72
75
|
element = element.parent();
|
73
76
|
visibility = element.css( "visibility" );
|
74
77
|
}
|
75
|
-
return visibility
|
78
|
+
return visibility === "visible";
|
76
79
|
}
|
77
80
|
|
78
|
-
$.extend( $.expr
|
81
|
+
$.extend( $.expr.pseudos, {
|
79
82
|
focusable: function( element ) {
|
80
83
|
return $.ui.focusable( element, $.attr( element, "tabindex" ) != null );
|
81
84
|
}
|
@@ -83,4 +86,4 @@ $.extend( $.expr[ ":" ], {
|
|
83
86
|
|
84
87
|
return $.ui.focusable;
|
85
88
|
|
86
|
-
} )
|
89
|
+
} );
|
@@ -2,79 +2,82 @@
|
|
2
2
|
//= require jquery-ui/version
|
3
3
|
|
4
4
|
/*!
|
5
|
-
* jQuery UI Form Reset Mixin 1.
|
6
|
-
*
|
5
|
+
* jQuery UI Form Reset Mixin 1.13.3
|
6
|
+
* https://jqueryui.com
|
7
7
|
*
|
8
|
-
* Copyright
|
8
|
+
* Copyright OpenJS Foundation and other contributors
|
9
9
|
* Released under the MIT license.
|
10
|
-
*
|
10
|
+
* https://jquery.org/license
|
11
11
|
*/
|
12
12
|
|
13
13
|
//>>label: Form Reset Mixin
|
14
14
|
//>>group: Core
|
15
15
|
//>>description: Refresh input widgets when their form is reset
|
16
|
-
//>>docs:
|
16
|
+
//>>docs: https://api.jqueryui.com/form-reset-mixin/
|
17
17
|
|
18
18
|
( function( factory ) {
|
19
|
-
|
19
|
+
"use strict";
|
20
20
|
|
21
|
-
|
22
|
-
define( [
|
23
|
-
"jquery",
|
24
|
-
"./form",
|
25
|
-
"./version"
|
26
|
-
], factory );
|
27
|
-
} else {
|
21
|
+
if ( typeof define === "function" && define.amd ) {
|
28
22
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
23
|
+
// AMD. Register as an anonymous module.
|
24
|
+
define( [
|
25
|
+
"jquery",
|
26
|
+
"./form",
|
27
|
+
"./version"
|
28
|
+
], factory );
|
29
|
+
} else {
|
33
30
|
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
// Browser globals
|
32
|
+
factory( jQuery );
|
33
|
+
}
|
34
|
+
} )( function( $ ) {
|
35
|
+
"use strict";
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
$.each( instances, function() {
|
42
|
-
this.refresh();
|
43
|
-
} );
|
44
|
-
} );
|
45
|
-
},
|
37
|
+
return $.ui.formResetMixin = {
|
38
|
+
_formResetHandler: function() {
|
39
|
+
var form = $( this );
|
46
40
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
41
|
+
// Wait for the form reset to actually happen before refreshing
|
42
|
+
setTimeout( function() {
|
43
|
+
var instances = form.data( "ui-form-reset-instances" );
|
44
|
+
$.each( instances, function() {
|
45
|
+
this.refresh();
|
46
|
+
} );
|
47
|
+
} );
|
48
|
+
},
|
52
49
|
|
53
|
-
|
54
|
-
|
50
|
+
_bindFormResetHandler: function() {
|
51
|
+
this.form = this.element._form();
|
52
|
+
if ( !this.form.length ) {
|
53
|
+
return;
|
54
|
+
}
|
55
55
|
|
56
|
-
|
57
|
-
|
58
|
-
}
|
59
|
-
instances.push( this );
|
60
|
-
this.form.data( "ui-form-reset-instances", instances );
|
61
|
-
},
|
56
|
+
var instances = this.form.data( "ui-form-reset-instances" ) || [];
|
57
|
+
if ( !instances.length ) {
|
62
58
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
59
|
+
// We don't use _on() here because we use a single event handler per form
|
60
|
+
this.form.on( "reset.ui-form-reset", this._formResetHandler );
|
61
|
+
}
|
62
|
+
instances.push( this );
|
63
|
+
this.form.data( "ui-form-reset-instances", instances );
|
64
|
+
},
|
67
65
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
} else {
|
73
|
-
this.form
|
74
|
-
.removeData( "ui-form-reset-instances" )
|
75
|
-
.off( "reset.ui-form-reset" );
|
76
|
-
}
|
77
|
-
}
|
78
|
-
};
|
66
|
+
_unbindFormResetHandler: function() {
|
67
|
+
if ( !this.form.length ) {
|
68
|
+
return;
|
69
|
+
}
|
79
70
|
|
80
|
-
|
71
|
+
var instances = this.form.data( "ui-form-reset-instances" );
|
72
|
+
instances.splice( $.inArray( this, instances ), 1 );
|
73
|
+
if ( instances.length ) {
|
74
|
+
this.form.data( "ui-form-reset-instances", instances );
|
75
|
+
} else {
|
76
|
+
this.form
|
77
|
+
.removeData( "ui-form-reset-instances" )
|
78
|
+
.off( "reset.ui-form-reset" );
|
79
|
+
}
|
80
|
+
}
|
81
|
+
};
|
82
|
+
|
83
|
+
} );
|
@@ -1,22 +1,25 @@
|
|
1
1
|
//= require jquery-ui/version
|
2
2
|
|
3
3
|
( function( factory ) {
|
4
|
-
|
4
|
+
"use strict";
|
5
5
|
|
6
|
-
|
7
|
-
define( [ "jquery", "./version" ], factory );
|
8
|
-
} else {
|
6
|
+
if ( typeof define === "function" && define.amd ) {
|
9
7
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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";
|
14
17
|
|
15
18
|
// Support: IE8 Only
|
16
19
|
// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop
|
17
20
|
// with a string, so we need to find the proper form.
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
+
return $.fn._form = function() {
|
22
|
+
return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form );
|
23
|
+
};
|
21
24
|
|
22
|
-
} )
|
25
|
+
} );
|