I created a BUEditor save button as a replacement button for the standard save button in the comment form (with the help from a support request in this module issue page). I am using the following code:

js: $('#ajax-comments-submit', E.textArea.form).click();

You can probably tell from the code that I am using the ajax_comments module. The ajax_comments module shows a nice progress bar during comment save. But upon clicking the save button I don't get the progress bar. Although the button works as expected. Is there a way to solve the problem?

Comments

ufku’s picture

When you mouse-click a button, it's not just the click event that fires. Mousedown, mouseup and click events are triggered in order. So, in order to mimic mouse click you should use:
js: $('#ajax-comments-submit', E.textArea.form).mousedown().mouseup().click();

udvranto’s picture

Looking at the ajax_comments.js I used the following. Still didn't work:

js: submitted = true; $('#ajax-comments-submit', E.textArea.form).click();
udvranto’s picture

ufku,
Thanks very much! That did the trick!!

ufku’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.