FortAwesome / Font-Awesome

The iconic SVG, font, and CSS toolkit
https://fontawesome.com
Other
73.7k stars 12.19k forks source link

"fa fa-spinner fa-spin" and "fa fa-spinner fa-pulse" stop spinning #7225

Open jonathanparrish opened 9 years ago

jonathanparrish commented 9 years ago

Hello, I have a web app that uses the "fa fa-spinner fa-spin". It's part of a modal, in a partial that I call during an ajax call. The spinner/modal launch and start normally, however after a second or so, the spinner freezes. Then, right before the modal disappears, you can see the spinner start up right before the modal closes. The "fa fa-spinner fa-pulse" didn't start spinning at all. The spinner works fine in Safari and Chrome, but doesn't work properly in Firefox or IE. Thanks, JP

my partial

<div id="spinner_modal" class="modal fade bs-example-modal-sm text-center" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
  <div class="modal-dialog modal-sm fa-4x">
    <div class="modal-content">
      <i class="fa fa-spinner fa-spin"></i>
    </div>
  </div>
</div>

my js file

$(document).ready(function() {
  $('#search_btn').on('click', function() {
    $('#results').empty();
    var myForm = $('#user_search');
    $("#spinner_modal").modal("show");
    $.ajax({
      url: myForm.attr('action'),
      type: "POST",
      data: myForm.serialize(),
      dataType: 'text',
      success: function(html){
        $("#spinner_modal").modal("hide");
        $('#results').append(html);
      },
      error: function(xhr, satus, err) {
        $("#spinner_modal").modal("hide");
      },
      timeout: 60000
    });
    return false;
  });
  $('#menu_uncleared').click(function() {
    $('#tab_ind').val('uncleared');
  });
  $('#menu_cleared').click(function() {
    $('#tab_ind').val('cleared');
  });
});
jonathanparrish commented 9 years ago

corrected in above code

tagliala commented 9 years ago

Do you mind to create a fiddle showing the isue?

You can start with this one: http://jsfiddle.net/tagliala/4ya23yjL/ (just fontawesome, you need to load bootstrap)

jonathanparrish commented 9 years ago

The code that I have is on my work computer, and contains sensitive information that I am not allowed to post. I'm not sure how i could replicate the issue in fiddle with out it. Any thoughts?

A bit more info about the ajax call.

It is a search button that returns search criteria. The table that it is searching is 3900 +/- rows. The whole search lasts 3 to 4 seconds max.

I hope this helps...

Jonathan

On Thu, Aug 13, 2015 at 10:58 AM, Geremia Taglialatela < notifications@github.com> wrote:

Do you mind to create a fiddle showing the isue?

You can start with this one: http://jsfiddle.net/tagliala/4ya23yjL/ (just fontawesome, you need to load bootstrap)

— Reply to this email directly or view it on GitHub https://github.com/FortAwesome/Font-Awesome/issues/7225#issuecomment-130721156 .

tagliala commented 9 years ago

I just need the minimum amount of code that shows the issue, without sensitive information. Or without information at all.

Just need the modal and the modal markup and the spinning icon

jonathanparrish commented 9 years ago

I'm not sure how fiddle works. Try this and let me know if this is what you were expecting.

http://jsfiddle.net/jonathanparrish/4ya23yjL/4/

On Fri, Aug 14, 2015 at 11:48 AM, Geremia Taglialatela < notifications@github.com> wrote:

I just need the minimum amount of code that shows the issue, without sensitive information. Or without information at all.

Just need the modal and the modal markup and the spinning icon

— Reply to this email directly or view it on GitHub https://github.com/FortAwesome/Font-Awesome/issues/7225#issuecomment-131156945 .

jonathanparrish commented 9 years ago

or

http://jsfiddle.net/jonathanparrish/auay3pzx/

On Fri, Aug 14, 2015 at 1:15 PM, Jonathan Parrish yoda.peh@gmail.com wrote:

I'm not sure how fiddle works. Try this and let me know if this is what you were expecting.

http://jsfiddle.net/jonathanparrish/4ya23yjL/4/

On Fri, Aug 14, 2015 at 11:48 AM, Geremia Taglialatela < notifications@github.com> wrote:

I just need the minimum amount of code that shows the issue, without sensitive information. Or without information at all.

Just need the modal and the modal markup and the spinning icon

— Reply to this email directly or view it on GitHub https://github.com/FortAwesome/Font-Awesome/issues/7225#issuecomment-131156945 .

tagliala commented 9 years ago

The fiddle is supposed to show your issue, so I expect that the spinner stops spinning after a short while on firefox

tagliala commented 9 years ago

21 minutes, still spinning :)

FF 39.0.3, Win10 x64

jonathanparrish commented 9 years ago

The spinner stops after just a second or maybe two of running. It then starts again milliseconds before the modal closes. The modal is tied to a search function. The fiddle doesn't replicate that.....

somefunAgba commented 7 years ago

Attach an id to the spinner element. Then in your ajax call completion or success, use that id to remove class fa-spin using jquery.