<p></p>
<blockquote>
<blockquote>
<p dir="auto">Why should they be written outside of javascript?</p>
</blockquote>
<p dir="auto">Because there is html involved, and there are CSS style rules applied to that html. So if I want to make changes to that html, or the layout of where the spinner appears,</p>
</blockquote>
<p dir="auto">You know that one of the various methods of placing these spinners is having a hidden spinner stashed somewhere then copying it to the place where it needs to appear with javascript. You are not controlling <em>where</em> with html in this case.</p>
<blockquote>
<p dir="auto">or add an extra div or add padding or anything like that, then I should be looking in the <code class="notranslate">app/views</code> directory to find the html code and css classes.</p>
</blockquote>
<p dir="auto">Make a spinner template, embed it in <code class="notranslate">osm.js.erb</code>, use it when you need a spinner to appear. This file already had some spinner-related code (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/openstreetmap/openstreetmap-website/commit/8bc7793d4233b9836e0d3513583ec76762128dd9/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/commit/8bc7793d4233b9836e0d3513583ec76762128dd9"><tt>8bc7793</tt></a>).</p>
<p dir="auto">Here's the template:</p>
<pre class="notranslate"><code class="notranslate">  <div class="text-center">
    <div class="spinner-border" role="status">
      <span class="visually-hidden"><%= t("browse.start_rjs.loading") %></span>
    </div>
  </div>
</code></pre>
<blockquote>
<p dir="auto">We can by all means use JavaScript to implement the interactivity, but we shouldn't be using it for constructing html layouts or managing CSS classes.</p>
</blockquote>
<p dir="auto">Are you saying that we shouldn't remove spinners with javascript? Or removing them is ok because it's somehow not constructing/managing but placing them is not ok?</p>
<p dir="auto">Continuing <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="23996607" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/647" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/647/hovercard?comment_id=1308694592&comment_type=issue_comment" href="https://github.com/openstreetmap/openstreetmap-website/issues/647#issuecomment-1308694592">#647 (comment)</a>, where would you put loading indicators on a page that works without javascript? Where would you put loading indicators on pages that work with turbo?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3779#issuecomment-1319818750">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMZTVR7Z4OL6TVCIV3WI5LO5ANCNFSM6AAAAAARTQGJDA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLNRI4XG6CBWZVJVLI3WI5LO5A5CNFSM6AAAAAARTQGJDCWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSOVLK74.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/3779/c1319818750</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/3779#issuecomment-1319818750",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/3779#issuecomment-1319818750",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>