Custom Content Type Giving me "Leave Page" warning


(Nic Hubbard) #1

I am working on a new Custom Content Type. For some reason, when I edit the contents and click Commit I get the javascript error that I normally get when trying to navigate away from the page, but this isn't the case, I am just trying to save:

 

Screen%20Shot%202014-11-12%20at%204.20.0

 

Is there something that I have missed in my code that prevents that? Or that makes the page know that I am not trying to navigate away, but only saving?


(Nic Hubbard) #2

Come on Matrix devs, don't leave me hanging....


(Ashish Karelia) #3

Hi Nic,

You'll need to add and "else if" block for your event to core/lib/js/state.js::saveState()

If you look at the code you'll see that fair few events are being skipped (like context changer) to make sure Matrix doesn't see this event as a change and then warn about the unsaved changes.

 

HTH.

 

Ash