2

when using rails 4 turbo-links, how do you change the mouse cursor to progress when a link is clicked?

i have tried this with no success:

application.js.erb

$(function() {
    $(window).ajaxStart(function() {
       $(this).css({'cursor' : 'progress'});
    }).ajaxStop(function() {
       $(this).css({'cursor' : 'default'});
    });
});

thanks!

amitben
  • 670
  • 10
  • 21

1 Answers1

1

I found a jquery patch to help, although i wonder if there is a better solution..

in the mean time this thread helped me:

application.js.erb

$(function() {
    $(document).on('page:fetch',   function() { $('body').css( 'cursor', 'progress' ); });
    $(document).on('page:change',  function() { $('body').css( 'cursor', 'default' ); });
});
Community
  • 1
  • 1
amitben
  • 670
  • 10
  • 21