Support Forum

Reply button not properly setting anchor and showing the editor form

< 1 2 3 >
Yellow Swordfish
Glinton, England
Member
Aug 28, 2017 - 3:43 am

I don't really have any way of knowing if you have dome something wrong. Give me a detailed step-by-step description of what you are seeing and I will see if I can replicate. I certainly can not based on what you have described previous to the change.

Sebastian Schimpf
Member
Aug 28, 2017 - 4:11 am

Thanks Andy, but this is way to complicated for me right now. 
I did exactly what you suggested and it did not work. 
I also don't like the fact that the forums scripts are not compressed anymore after making this change. Our site is not the fastest, this will add even more weight to it. 

I am out. I need to find a better solution for this issue or ignore it for now. 

Sebastian Schimpf
Member
Aug 28, 2017 - 4:49 am

Could you possibly sent me the compressed JS file with the change in it, so I may just replace the one on our server?
Maybe that will work. 

sebastian.schimpf {at} gmail.com

Yellow Swordfish
Glinton, England
Member
Aug 28, 2017 - 5:36 am

We can see if that is possible. There are a lot of changes to all of our JavaScript files for 5.8 so it would need to be hand-crafted. I will try and take a look later today.

Sebastian Schimpf
Member
Aug 28, 2017 - 5:49 am

okay ... please see what you can do. 

Thanks!

Mr Papa
Simi Valley, CA
Member
Free Members
Aug 28, 2017 - 9:22 pm

if its loading sp-forum.js and not sp-forum-dev.js, its not loading the one you modified...  please show us what you added to wp-config.php and show us where you added it...  make sure you have valid quote chars... sometimes if you copy it from formatted html you may get the wrong one... always best when copying code to use the copy raw button...

I have already coded up a enhancement for the reply button to always scroll to the form...

in the same js file, find these lines (sorry, dont have line number as I am on travel)...

                        $('#' + editorId).slideDown();
                        if (!window.location.hash) location.href = location.href + '#spEditFormAnchor';
                        spj.editorOpen(formType);

after those, just add:

                        $('html, body').animate({scrollTop: $('#' + editorId).offset().top - sp_platform_vars.headpadding}, 500);

which of course assumes you can get it to load the right file...

Sebastian Schimpf
Member
Aug 29, 2017 - 3:05 am

Thanks, Mr. Papa, 

the issue was indeed my copy and paste of the code you gave me for the wp-config.php!

After i corrected the code to use proper quotes, it works. 
Thank you!

However, I think there is a weakness in the way you have coded this button feature in general.

When I scroll up, after the click on the button took me to the text editor, and I click again on the button, nothing happens. In my opinion, it would be more user-friendly if the focus would again lead the user directly to the text editor, no matter if he was there already or not. 
So I think it would be smarter to make sure the button always scrolls to the form - no matter what. 

What are your thoughts?

Yellow Swordfish
Glinton, England
Member
Aug 29, 2017 - 3:43 am

Is that a browser specific problem? It certainly does what you want on our test systems in both MacOS and Windows browsers...

Sebastian Schimpf
Member
Aug 29, 2017 - 4:01 am

On my Windows machine, it seems to appear in Chrome and Opera, not in IE 11 and Firefox. 

Yellow Swordfish
Glinton, England
Member
Aug 29, 2017 - 4:20 am

I shall need to pass that one over to @mr-papa as I do not have a Windows PC

< 1 2 3 >