Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added options ngDisableOnChange, ngDisableOnKeyUp and ngDisableOnBlur… #68

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

bestis
Copy link

@bestis bestis commented Oct 27, 2015

… to control how changes in ckeditor is digested by angularjs.

We are having many ckeditors in one page and the data is pretty big. AngularJS digesting every key press makes the page really annoying and slow to edit. This change would allow controlling how the changes in ckeditor is digested by angularjs and helping to make our page usage smoother.

Jani Ollikainen added 2 commits October 27, 2015 09:43
… to control how changes in ckeditor is digested by angularjs.
@bestis
Copy link
Author

bestis commented Oct 27, 2015

Made the release 0.2.2 to my fork, because we need this now and changed to use our fork, but will gladly come back if there is way to control that in ng-ckeditor. Doesn't need to be like I did, but functionality wise it should at least what this offers.

@ditmermda
Copy link

You could also debounce the setModelData function with a reasonable delay, such that is not fired as often and typically not when people are writing.

This has the added benefit, that the event will eventually fire, such that you will not have to wait for a blur event to update the model (if, for example you have other view components dependent on the model state, such as a Submit button which is only enabled when there is content).

I have fixed our performance issues by this little change.

@bestis
Copy link
Author

bestis commented Dec 11, 2015

Well delay is kind of bad in my case, as one can edit the text and press save directly and if angular haven't digested the edited text then save will send the old one.

I'm using that Valvefi@bd1e2c0 element.bind and still can sometimes fail, especially if browser seems to be on the slow side, but editing the text is nice.

Played with debounce, something like the documentation says "ng-model-options="{ updateOn: 'default blur', debounce: { 'default': 500, 'blur': 0 } }"", but the default action was still too slow for the users.. Can't remember did I try that only with blur and how would have that worked. But now I'm pretty happy with that. If someone can do it better and get that merged to ng-ckeditor, or have done better ng-ckeditor, happy to drop my fork and use it :)

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

Successfully merging this pull request may close these issues.

2 participants