Forum Discussion

Gursimrat's avatar
Gursimrat
Leader
11 years ago
Solved

Auto refresh page after the reply is posted

When a user posts a reply via quick reply, it shows a link "go to post" rather than displaying the reply directly, is there any setting in admin which will allow us to let the users see their reply directly rather then them have to click a link to see it?

  • Hi Gursimrat ,

     

    my pleasure. here it goes.

     

    <@liaAddScript>
    ;(function($) {
    
        $(document.body).bind("LITHIUM:ajaxSuccess:QuickReply", function(event, response) { 
            location.reload(true);
        })
    
    })(LITHIUM.jQuery);
    

     

     

     

3 Replies

  • HaidongG's avatar
    HaidongG
    Lithium Alumni (Retired)
    11 years ago

    Hi Gursimrat 

     

    as I know, currently, there is no such a setting to auto refresh page after a quick reply, there are some ideas on submitted earlier. you may want to Kudos them. (ref 1 and ref 2)

     

    For one of my customer, I have built a workaround solution which refreshes the current page once quick reply is posted. the limitation is that, 

    • the whole page will be refreshed, instead of "inserting" the new reply.
    • if there a pagination in the thread, the new reply will be inserted into the last page, but we will stay on the current page instead of going to the last page.

    I am happy to share my code if you are willing to know more.

     

    Best Regards

    Haidong

  • Gursimrat's avatar
    Gursimrat
    Leader
    11 years ago

    HaidongG 

    Sure, it would be great if you can share the code, we wont have pagination issue to much extent as we are using 50 replies per page.

  • HaidongG's avatar
    HaidongG
    Lithium Alumni (Retired)
    11 years ago

    Hi Gursimrat ,

     

    my pleasure. here it goes.

     

    <@liaAddScript>
    ;(function($) {
    
        $(document.body).bind("LITHIUM:ajaxSuccess:QuickReply", function(event, response) { 
            location.reload(true);
        })
    
    })(LITHIUM.jQuery);