src/rails_admin/ui.js in rails_admin-3.1.1 vs src/rails_admin/ui.js in rails_admin-3.1.2
- old
+ new
@@ -86,11 +86,11 @@
document.dispatchEvent(event);
}
$(document).ready(triggerDomReady);
document.addEventListener("turbo:render", triggerDomReady);
- document.addEventListener("rails_admin.dom_ready", function () {
+ document.addEventListener("rails_admin.dom_ready", function (event) {
$(".nav.nav-pills li.active").removeClass("active");
$(
'.nav.nav-pills li[data-model="' + $(".page-header").data("model") + '"]'
).addClass("active");
$(".animate-width-to").each(function () {
@@ -127,9 +127,15 @@
});
// Workaround for https://github.com/heartcombo/devise/issues/5458
$("a[data-method]").on("click", function (event) {
window.Turbo.session.drive = false;
});
+
+ // Trigger via jQuery for compatibility with existing user codes
+ $(document).trigger(
+ "rails_admin.dom_ready",
+ event.detail ? [event.detail] : null
+ );
});
$(document).on("click", ".bulk-link", function (event) {
event.preventDefault();
$("#bulk_action").val($(this).data("action"));