You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#117006 Avoiding "jump to top" when pressing "save"-button

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Ryan on Friday, 20 December 2024 10:05 GMT

HGH

When editing with JCE, the editing text area jumps up when you press the "Save" button.

However, pressing the "Save" button means that you only want to temporarily save and may continue working at the current cursor position. Today you have to manually scroll to the last edited position.

This is very annoying with large files.

It would be great if there was a solution to the problem that saved the window position and returned to the starting position after pressing the Save button.

I think a small plugin with some javascripts could provide the solution. But I'm not familiar enough with it myself.

Can we get a solution ?

Ryan

This is not actually as easy to implement as it would first appear.

Because the page reloads when you click Save, the cursor position must be stored in the browser storage system, then restored when the page is reloaded.

The problem is that there is no way to differentiate between the article you are working on, and any other article you edit later (the editor id might be the same), so loading the different article would cause the cursor to move to the last saved position of the other article, which might be equally annoying.

Anyway I will think about it and see if I can implement something in the new year.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

HGH

Hi Ryan, 

maybe we can use the Typ and ID of the edited object to avoid wrong reloading?

 

Ryan

Two different Joomla Article Manager articles are going to have exactly the same id and type, so there is no way to differentiate between them.

Using other values like article id and category id means that this feature would only work where those values are available in that syntax, so it would not be fully compatible with all extensions.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Ryan

I have an effective way to differentiate between articles, but I have encountered some other issues. Nevertheless I am working on a solution.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Ryan

Please try JCE Pro 2.9.83 RC2 - https://www.joomlacontenteditor.net/downloads/editor/pro/development

Go to the Editor Global Configuration and set a Custom Configuration Variable option with a Key of refocus and Value or true, eg:

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

HGH

Hi Ryan,

 

first of all many thanks for your engagement.

I've done all as you said, but I can't see any effect.

B.t.w., for a short moment at the first test, I thought there was a forward-scroll after pressing "save"-button, but when inspecting it more differently, that was not right.

B.t.w(2) ... the option to focus only on articles will need to be expanded later, as it is possible to edit many other content types.

Ryan

This effect will only restore the cursor to the point it was when the save button was clicked, it does not also scroll to that point.

It supports any extension, but only the active editor when the save button is clicked.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

HGH

... I've tested it again with the focus on your explanations, but I still can't see any effect - the cursor isn't visible at the last position before pressing "save" .  See video.

Ryan

I have made some improvements in RC3 - https://www.joomlacontenteditor.net/downloads/editor/pro/development

Here is the result of one of my tests. You can see the cursor position is restored after saving.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

HGH

... that looks good in your environment, but here it still doesn't run.   See video.
I've cleared all caches.

Fore your notice, I've installed some tools by RegularLabs.

Ryan

I think the difference here is that this will currently only place the cursor at the end of the line of the container element, eg: paragraph, so it might not be noticeable where there is a lot of text with linbreaks in a block element.

I will see if I can improve this to restore the exact cursor position, but I don't know if this is possible.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.