Notifications
Clear all

Paid Addons Support Forum Only

Please note, that here we only support Paid Addons issues and questions.

gVectors Support staff works from 6am to 6pm (GMT+0)

All questions related to wpForo and wpDiscuz free plugins should be asked in the corresponding plugin support forum:

 

wpDiscuz Support Forum   wpForo Support Forum

[Solved] Inverse drop animation for comment form after Submit  

  RSS

angelochiacchio
(@angelochiacchio)
Active Member
Joined: 4 months ago
Posts: 11
07/04/2020 12:56 pm  

Is there a way to close back the form to show only the first textarea after the user has submitted? Possibly with the same animation?

Right now I forced a display:none of .wc-form-footer on submit using jquery.

The goal is to show the user a feedback of his comment being posted.

Thanks

This topic was modified 4 months ago by angelochiacchio

Quote
Astghik
(@astghik)
Support Team Admin
Joined: 3 years ago
Posts: 4344
07/04/2020 2:40 pm  

Hi @angelochiacchio,

Please follow the steps below:

1. Put the following js code in the js files of the active theme:

wpdiscuzAjaxObj.wpdiscuzSlideUp = function () {
var parent = jQuery('.wc-main-form-wrapper');
jQuery('.commentTextMaxLength', parent).hide();
jQuery('.wc-form-footer', parent).slideUp(wpdiscuzAjaxObj.wpdiscuz_options.enableDropAnimation ? 500 : 0);
jQuery('.wc_comment', parent).focusout();
}

Helpful article: https://www.collectiveray.com/add-javascript-to-wordpress

2. The PHP code below should be put in the active theme's functions.php file:

add_filter("wpdiscuz_comment_post", function ($r){
$r["callbackFunctions"][] = "wpdiscuzSlideUp";
return $r;
});

ReplyQuote
angelochiacchio
(@angelochiacchio)
Active Member
Joined: 4 months ago
Posts: 11
07/04/2020 2:57 pm  

Thank you,

it doesn't work. Is the procedure the same while using a child theme?


ReplyQuote
angelochiacchio
(@angelochiacchio)
Active Member
Joined: 4 months ago
Posts: 11
07/04/2020 4:30 pm  

Actually the function is called but not recognized

Screenshot 2020 04 07 at 14.29.13

ReplyQuote
Astghik
(@astghik)
Support Team Admin
Joined: 3 years ago
Posts: 4344
07/04/2020 4:48 pm  

@angelochiacchio

Please try to add the js code in the wpDiscuz plugin js codes. The wpdiscuz.js file is located in the /wp-content/plugins/wpdiscuz/assets/js/ folder. 

Don't forget to remove it from the previous place you've added. 


ReplyQuote
angelochiacchio
(@angelochiacchio)
Active Member
Joined: 4 months ago
Posts: 11
07/04/2020 5:04 pm  

I works now! Thanks a lot!

This post was modified 4 months ago by angelochiacchio

ReplyQuote
angelochiacchio
(@angelochiacchio)
Active Member
Joined: 4 months ago
Posts: 11
07/04/2020 5:27 pm  

However in doesn't seem to be working on mobile, which is more important. Any idea why?


ReplyQuote
angelochiacchio
(@angelochiacchio)
Active Member
Joined: 4 months ago
Posts: 11
07/04/2020 5:43 pm  

You can test it at http://ideasfortomorrow.me/


ReplyQuote
Astghik
(@astghik)
Support Team Admin
Joined: 3 years ago
Posts: 4344
08/04/2020 2:39 pm  

@angelochiacchio,

Probably this is just a cache issue. Please try on incognito mode. Because mobile browsers have a hard cache, you'll not be able to see the change immediately.


ReplyQuote
angelochiacchio
(@angelochiacchio)
Active Member
Joined: 4 months ago
Posts: 11
08/04/2020 2:53 pm  

Indeed. It is working fine now. Thank you!


ReplyQuote
Astghik
(@astghik)
Support Team Admin
Joined: 3 years ago
Posts: 4344
08/04/2020 2:54 pm  

@angelochiacchio,

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.


ReplyQuote
Share: