Activate TrackChanges in WebApp

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
aleh.haidash
Posts: 24

Activate TrackChanges in WebApp

Fri Oct 21, 2016 11:39 am

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: 131

Re: Activate TrackChanges in WebApp

Fri Oct 21, 2016 2:33 pm

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: 24

Re: Activate TrackChanges in WebApp

Fri Oct 21, 2016 2:47 pm

Hello.
Thanks for the answer.
Best Regards,
Aleh

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 1 guest