Skip to content

Commit

Permalink
Upgrade Select2 to v4
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 committed Apr 13, 2021
1 parent c189541 commit f061c4a
Show file tree
Hide file tree
Showing 117 changed files with 177 additions and 206 deletions.
4 changes: 2 additions & 2 deletions docs/reference/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Full Configuration Options
- bundles/sonataadmin/dist/icheck/skins/square/blue.css
- bundles/sonataadmin/vendor/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css
- bundles/sonataadmin/vendor/jqueryui/themes/base/jquery-ui.css
- bundles/sonataadmin/dist/select2/select2.css
- bundles/sonataadmin/dist/select2/select2.min.css
- bundles/sonataadmin/dist/select2-bootstrap-css/select2-bootstrap.min.css
- bundles/sonataadmin/dist/x-editable/bootstrap-editable.css
- bundles/sonataadmin/css/styles.css
Expand All @@ -213,7 +213,7 @@ Full Configuration Options
- bundles/sonataadmin/dist/jquery-form/jquery.form.js
- bundles/sonataadmin/vendor/jquery.confirmExit/jquery.confirmExit.js
- bundles/sonataadmin/dist/x-editable/bootstrap-editable.min.js
- bundles/sonataadmin/dist/select2/select2.js
- bundles/sonataadmin/dist/select2/select2.min.js
- bundles/sonataadmin/dist/admin-lte/js/adminlte.min.js
- bundles/sonataadmin/dist/icheck/icheck.min.js
- bundles/sonataadmin/dist/jquery-slimcroll/jquery.slimscroll.min.js
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"masonry-layout": "4.2.2",
"moment": "2.17.1",
"readmore-js": "2.2.1",
"select2": "3.5.1",
"select2-bootstrap-css": "1.4.6",
"select2": "^4.0",
"select2-bootstrap-css": "^1.4.6",
"waypoints": "4.0.1",
"x-editable": "1.5.1"
},
Expand Down
4 changes: 2 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ public function getConfigTreeBuilder(): TreeBuilder
'bundles/sonataadmin/vendor/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
'bundles/sonataadmin/vendor/jqueryui/themes/base/jquery-ui.css',

'bundles/sonataadmin/dist/select2/select2.css',
'bundles/sonataadmin/dist/select2/select2.min.css',
'bundles/sonataadmin/dist/select2-bootstrap-css/select2-bootstrap.min.css',
'bundles/sonataadmin/dist/x-editable/bootstrap-editable.css',

Expand Down Expand Up @@ -436,7 +436,7 @@ public function getConfigTreeBuilder(): TreeBuilder
'bundles/sonataadmin/vendor/jquery.confirmExit/jquery.confirmExit.js',

'bundles/sonataadmin/dist/x-editable/bootstrap-editable.min.js',
'bundles/sonataadmin/dist/select2/select2.js',
'bundles/sonataadmin/dist/select2/select2.min.js',
'bundles/sonataadmin/dist/admin-lte/js/adminlte.min.js',
'bundles/sonataadmin/dist/icheck/icheck.min.js',
'bundles/sonataadmin/dist/jquery-slimcroll/jquery.slimscroll.min.js',
Expand Down
10 changes: 3 additions & 7 deletions src/Resources/public/Admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,8 @@ var Admin = {
}

select.select2({
width: function(){
// Select2 v3 and v4 BC. If window.Select2 is defined, then the v3 is installed.
// NEXT_MAJOR: Remove Select2 v3 support.
return Admin.get_select2_width(window.Select2 ? this.element : select);
width: function() {
return Admin.get_select2_width(select);
},
dropdownAutoWidth: true,
minimumResultsForSearch: minimumResultsForSearch,
Expand Down Expand Up @@ -569,9 +567,7 @@ var Admin = {

var options = Object.assign({
width: function(){
// Select2 v3 and v4 BC. If window.Select2 is defined, then the v3 is installed.
// NEXT_MAJOR: Remove Select2 v3 support.
return Admin.get_select2_width(window.Select2 ? this.element : subject);
return Admin.get_select2_width(subject);
},
dropdownAutoWidth: true,
data: transformedData,
Expand Down
108 changes: 61 additions & 47 deletions src/Resources/public/dist/manifest.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/af.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/ar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/az.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/bg.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/bn.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/ca.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/cs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/da.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/de.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/dsb.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/el.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/en.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/et.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/eu.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Resources/public/dist/select2/locale/fa.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f061c4a

Please sign in to comment.