Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions vendor/assets/javascripts/active_admin_date_range_preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,11 @@ $(function () {
return additional_items_html += '<div><span class="btn_date_range_' + i + '">' + el['title'] + '</span></div>';
});

// Bind in the same tick the popup is appended. jQuery 3 reimplemented
// .ready() on top of a Deferred, whose .then schedules through
// setTimeout, so handlers attached inside it landed a macrotask late
// and the popup was on screen but inert until then. jQuery 4 keeps
// that implementation, so waiting buys nothing there either, and
// .ready() on a non-document collection has been deprecated since 3.0.
// Bind in the same tick the popup is appended. Active Admin 3 ships
// jQuery 3, which rebuilt .ready() on top of a Deferred whose .then
// schedules through setTimeout, so handlers attached inside it landed
// a macrotask late and the popup was on screen but inert until then.
// On a non-document collection the method is deprecated anyway.
let container = $('<div style="min-width: '+e.target.offsetWidth+'px; top: '+(e.target.offsetTop)+'px; left: '+(e.target.offsetLeft)+'px" class="block_timerange">' +
'<div><span class="btn_today">Today</span></div>' +
'<div><span class="btn_yesterday">Yesterday</span></div>' +
Expand Down
Loading