diff --git a/app/assets/javascripts/rails_admin/jquery-ui.js.erb b/app/assets/javascripts/rails_admin/jquery-ui.js.erb new file mode 100644 index 0000000000..cce243bfa0 --- /dev/null +++ b/app/assets/javascripts/rails_admin/jquery-ui.js.erb @@ -0,0 +1,8 @@ +<% require_asset "jquery-ui/effect" %> +<% if Jquery::Ui::Rails::JQUERY_UI_VERSION >= '1.12' %> + <% require_asset "jquery-ui/widgets/sortable" %> + <% require_asset "jquery-ui/widgets/autocomplete" %> +<% else %> + <% require_asset "jquery-ui/sortable" %> + <% require_asset "jquery-ui/autocomplete" %> +<% end %> diff --git a/app/assets/javascripts/rails_admin/rails_admin.js b/app/assets/javascripts/rails_admin/rails_admin.js index 67e6f8e0f6..85ef0ca124 100644 --- a/app/assets/javascripts/rails_admin/rails_admin.js +++ b/app/assets/javascripts/rails_admin/rails_admin.js @@ -1,9 +1,7 @@ //= require 'jquery' //= require 'jquery_ujs' //= require 'jquery.remotipart' -//= require 'jquery-ui/effect' -//= require 'jquery-ui/sortable' -//= require 'jquery-ui/autocomplete' +//= require 'rails_admin/jquery-ui' //= require 'rails_admin/moment-with-locales' //= require 'rails_admin/bootstrap-datetimepicker' //= require 'rails_admin/jquery.colorpicker' diff --git a/rails_admin.gemspec b/rails_admin.gemspec index 3d35155a11..f80ddb5314 100644 --- a/rails_admin.gemspec +++ b/rails_admin.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'font-awesome-rails', ['>= 3.0', '< 5'] spec.add_dependency 'haml', '>= 4.0', '< 6' spec.add_dependency 'jquery-rails', ['>= 3.0', '< 5'] - spec.add_dependency 'jquery-ui-rails', '~> 5.0' + spec.add_dependency 'jquery-ui-rails', ['>= 5.0', '< 7'] spec.add_dependency 'kaminari', '>= 0.14', '< 2.0' spec.add_dependency 'nested_form', '~> 0.3' spec.add_dependency 'rack-pjax', '>= 0.7'