Activate TrackChanges in WebApp

Having trouble installing Oxygen? Got a bug to report? Post it all here.
aleh.haidash
Posts: 32
Joined: Tue May 26, 2015 10:28 am

Activate TrackChanges in WebApp

Post by aleh.haidash »

I use Webapp 18.0.6. And I need activate trackchanges depending on my condition. How can I do it?
I tried like this way, but it not work. Button "TrackChanges" pressed but Track Changes doesn't work.

Code: Select all


goog.events.listen(window.editor, sync.api.Editor.EventTypes.ACTIONS_LOADED, function(e) {
if(<my condition>){
var trackChangesAction = editor.getActionsManager().getActionById("Author/TrackChanges");
if(trackChangesAction!=null){
trackChangesAction.actionPerformed();
}
}
});
Best Regards,
Aleh
cristi_talau
Posts: 496
Joined: Thu Sep 04, 2014 4:22 pm

Re: Activate TrackChanges in WebApp

Post by cristi_talau »

Hello,

The "Track changes" state in oXygen can be controlled in several ways:
1. By the user, when pressing the "Toggle change tracking" button.
2. It may be saved in the document (check for a <?oxy_options track_changes="on"?> processing instruction at the end of the document)
3. It is configured as an option (available in the Administration Page in Web Author 18.1).

I tried your code and it seems that:
- it changes the track changes state. It actually changes it three times. Maybe the initial state of the "Track changes" is not the one you expected.
- the toggled state of the button is not updated. Unfortunately there is currently no simple way to update the toggled state of a button. I will register an issue about that.

What you can do instead, if you want also the button state to be updated is to trigger synthetic mouse events on the button. I found this answer to work http://stackoverflow.com/a/24026594 .

Best,
Cristian
aleh.haidash
Posts: 32
Joined: Tue May 26, 2015 10:28 am

Re: Activate TrackChanges in WebApp

Post by aleh.haidash »

Hello.
Thanks for the answer.
Best Regards,
Aleh
Post Reply