Skip to content

Commit

Permalink
Restore the loading indicator back
Browse files Browse the repository at this point in the history
Closes #3500
  • Loading branch information
mshibuya committed Jun 26, 2022
1 parent c2bf6db commit 32e6b14
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/views/layouts/rails_admin/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
</head>
<body class="rails_admin">
<div data-i18n-options="<%= I18n.t("admin.js").to_json %>" id="admin-js"></div>
<div class="badge bg-warning" id="loading" style="display:none; position:fixed; right:20px; bottom:20px; z-index:100000">
<%= t('admin.loading') %>
</div>
<nav class="navbar navbar-expand-md fixed-top <%= RailsAdmin::Config.navbar_css_classes.join(' ') %>">
<%= render "layouts/rails_admin/navigation" %>
</nav>
Expand Down
1 change: 1 addition & 0 deletions config/locales/rails_admin.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ en:
too_many_objects: "Too many objects, use search box above"
no_objects: "No objects found"
clear: Clear
loading: "Loading..."
toggle_navigation: Toggle navigation
home:
name: "Home"
Expand Down
4 changes: 4 additions & 0 deletions src/rails_admin/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import I18n from "./i18n";
$("#list [name='bulk_ids[]']").prop("checked", $(this).is(":checked"));
});

$(document).on("turbo:click", function () {
return $("#loading").show();
});

$(document).on("click", "[data-bs-target]", function () {
if (!$(this).hasClass("disabled")) {
if ($(this).has("i.fa-chevron-down").length) {
Expand Down

0 comments on commit 32e6b14

Please sign in to comment.