Skip to content

Commit

Permalink
Show spinner using delayed css animation in sidebar loader
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Nov 13, 2024
1 parent 9fded02 commit c3b17aa
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions app/assets/javascripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
//= require qs/dist/qs

$(document).ready(function () {
var loaderTimeout;

var map = new L.OSM.Map("map", {
zoomControl: false,
layerControl: false,
Expand All @@ -39,11 +37,7 @@ $(document).ready(function () {

map.setSidebarOverlaid(false);

clearTimeout(loaderTimeout);

loaderTimeout = setTimeout(function () {
$("#sidebar_loader").show();
}, 200);
$("#sidebar_loader").show().addClass("delayed-fade-in");

// IE<10 doesn't respect Vary: X-Requested-With header, so
// prevent caching the XHR response as a full-page URL.
Expand All @@ -60,9 +54,8 @@ $(document).ready(function () {
url: content_path,
dataType: "html",
complete: function (xhr) {
clearTimeout(loaderTimeout);
$("#flash").empty();
$("#sidebar_loader").hide();
$("#sidebar_loader").removeClass("delayed-fade-in").hide();

var content = $(xhr.responseText);

Expand Down

0 comments on commit c3b17aa

Please sign in to comment.