Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

fix($dirty): check if editor is dirty before updating view #239

Closed
wants to merge 3 commits into from
Closed

fix($dirty): check if editor is dirty before updating view #239

wants to merge 3 commits into from

Conversation

MrMartiniMo
Copy link
Contributor

Related Issue: #238
thats my first PR, I hope I haven't messed it up 💥

@deeg
Copy link
Contributor

deeg commented Mar 10, 2016

Thanks for putting this up. Will take a look over it tonight.

Something that helps us is putting up a plunker with the fix so it is easy for us to test.

Also if you could add a test which verifies your fix that would be great.

@MrMartiniMo
Copy link
Contributor Author

Plunker with issue: http://plnkr.co/edit/INfZpLpz2yrRvlHitw1N
Plunker with fix: http://plnkr.co/edit/As6nkFJPr5bVAd884dRl

I will try to set up a few tests, but it will take some time.

@@ -63,8 +63,10 @@ angular.module('ui.tinymce', [])
$timeout.cancel(debouncedUpdateTimer);
debouncedUpdateTimer = $timeout(function() {
return (function(ed) {
ed.save();
updateView(ed);
if (!ed.isNotDirty) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want ed.isDirty() instead.

@wetternest
Copy link

this fix solves the problem for me, thx for sharing!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants