We used to use an AJAX spinning GIF, but removed it due to various theme issues:
https://buddypress.trac.wordpress.org/ticket/4610
I’ve added a patch for an alternative to the throbbler in 4951:
https://buddypress.trac.wordpress.org/ticket/4951
It uses a progress bar animation for the background of the button.
Hi @godavid33 I think users will always appreciate some sign of ‘we are working behind the scenes whilst you’re waiting’ especially when the wait happens to be for a few seconds. Perhaps you could share your code in a jsfiddle so we can see a demo?
Sorry, I’m a bit too lazy for jsfiddle but here is the code
jQuery('#send_reply_button').click(function(){
var submit_butt = jQuery(this);
submit_butt.hide();
submit_butt.attr('disabled', 'disabled');
if(!submit_butt.parent().find('.ajax-submit-gif').get(0))
submit_butt.parent().append("<img class='ajax-loader' src='ajax-loader.gif'/>");
jQuery(document).ajaxComplete(function(e, xhr, options){
submit_butt.show();
submit_butt.removeAttr('disabled');
submit_butt.parent().find('.ajax-submit-gif').remove();
jQuery(e.currentTarget).unbind('ajaxComplete');
});
});
My one suggest, and why I was looking for an alternative, is that as is now, if you have other ajax processes going on in the window, then they may trigger ajaxComplete in this code.
@godavid33,@henrywright
I brought the loading function back in one of the theme am building by using just css.
1, I added ajax spinner
2, I changed the button background while loading to make it look disabled.
below is an example for the post button:
#buddypress #whats-new-form a.loading,
#buddypress #whats-new-form input.loading {
padding-right: 25px ! important;
background-color:#bbb ! important;
background-image:url(“/wp-content/themes/your-theme/img/ajax-loader.gif” ) ! important;
background-position: 93% 50% ! important;
background-repeat: no-repeat ! important;
}
using #buddypress a.loading{} will affect almost all the button.
Naijaping
Nice, much more elegant @naijaping
@godavid33 and @naijaping – whilst on the subject of preloaders – check out this resource http://ilovepreloaders.tumblr.com/ – I’ve found it V useful in the past
Yo these are great. Love the rainbox and the ouroboro