Issue #720Opened January 5, 2018by krunal0390 reactions

Document Dirty Indicator

Question

Code SnippetTEXT
I want to display document dirty indicator unless document is saved to database. I have custom button on editor to save html to db I tried below #551 but it only fires while loading html from db to canvas and it does not fire for any changes afterward.

`editor.on('change:changesCount', () => {
      const editorModel = editor.getModel();
      const changes = editorModel.get('changesCount');
      if (changes) {
           //show dirty count
      }`

Answers (3)

artfJanuary 5, 20180 reactions

Tried this in the demo and works as expected

editor.on('change:changesCount', (model) => { 
	console.log('changed'); 
});
austinbiggsJanuary 5, 20180 reactions

@artf - I tried this in my code an nothing happens. This works for you?

I'm running v. 12.58 😄

artfJanuary 8, 20180 reactions

This works for you?

Yeah, it works with the demo (which uses the latest version)

I tried this in my code an nothing happens

Have you tried to change the structure of the template?

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.