WordPress.org

Ready to get started?Download WordPress

Forums

WP-Ajaxify-Comments
[resolved] I need an onUnblock callback (3 posts)

  1. kisshomaru
    Member
    Posted 1 year ago #

    I have a jquery plugin that works on the comments area on every page.
    After submitting the comment, the page is not reloaded, so the DOM changes state. After submit, it will block the ui then unblock it for the comments. I looked on their site but can't find/make it work.
    So I need globally to know when the unblock finished so I can refresh based on the new DOM on the other script at exactly the right time.
    I have it now on timeout to make it work on submit. Something like:

    $('#submit').click(function() {
    			//alert(updatefinsihed);
    			setTimeout(function(){
    				// my code on the comment box and refresh
    					}, 4000);
    
    		});

    Any chance there is a public method to that unblock?
    Another idea is for me to create a hidden someth through javascript on your afterupdatecomments, but I would rather not...

    http://wordpress.org/plugins/wp-ajaxify-comments/

  2. kisshomaru
    Member
    Posted 1 year ago #

    Back to this: is there any way I can know when the page is unblocked so i can run another script at the right time?
    Thanks.

  3. kisshomaru
    Member
    Posted 1 year ago #

    A well. Solved.
    Added my function directly in the 'OnAfterUpdateComments'. Something like this works, I just didn't like the idea of merging stuff (keeping things separate would have been better), and is to expensive to read for a hidden element:
    'OnAfterUpdateComments' callback:

    jQuery(document).ready(function($) {
       // My code.
    });

    I'll mark it as solved, I just hoe upgrades will leave it be...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.