Created
June 4, 2013 00:10
-
-
Save fredsterss/5702577 to your computer and use it in GitHub Desktop.
Elegant loading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# handle ajax events (loading and auth errors) | |
$(document).ajaxStart -> | |
settings = lines: 12, length: 6, width: 4, radius: 8, trail: 75, color: '#fff' | |
$('.loading-main').html new r.ui.spinner( settings ).spin().el | |
$('[data-section=logo]').addClass('loading') | |
$(document).ajaxStop -> | |
$('[data-section=logo]').removeClass('loading') | |
$(document).ajaxComplete (e, xhr, options) -> | |
r.errorHandler.handle(xhr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Open Source this :)