was just skimming :-( and noticed the difference in the title, apologies.
no-dirty-check directive will work if you place it on the actual
I'm not super sure if you are using the umb property editor directive wrapper around the rte property editor how you would do that - I can't see a way in the source code of applying a similar rule to prevent dirtyness from being checked.
The Unsaved changes modal only appears if the form is 'dirty'...
if you are working in a custom dashboard, then saving the item won't know to mark your form undirty
if you look in dev tools, you'll see the dirty class appear on your form entry when you start editing in the field, and see that it remains even when you save.
setPristine(); is probably the correct thing to do here
but it's getting a reference to your dashboard form that appears to be the challenge!
There is an example from a post, referenced from the other forum post:
var contentForm = angular.element('form[name=contentForm]').scope().contentForm;
would that approach get you your form and allow you to call setPristine(); ?
but I'm not sure why it's not finding it or if it is finding it, why .scope is undefined... frustrating because I reckon calling setPristine would get rid of the ng-dirty css class and then the un saved changes dialog wouldn't be triggered...
Custom section - reuse rte - set no -dirty to model
Hey
I have some trouble in a custom section that I have build.
I'm reusing to rte from Umbraco with this.
And that gives me
When I type in text I would like to prevent the "do you wanna save your changes" modal that pops up when an editor leaves the page..
I have tried with "no-dirty" on the umb-property-editor put that didn't do the trick... Is there away to get that ?
Anyone ??
Hi Thomas
Is it
that you are after?
instead of
??
regards
Marc
Mistyping... did use no-dirty-check... :)
Still not working, asking for the editor to save changes
Sorry Thomas
was just skimming :-( and noticed the difference in the title, apologies.
no-dirty-check directive will work if you place it on the actual
I'm not super sure if you are using the umb property editor directive wrapper around the rte property editor how you would do that - I can't see a way in the source code of applying a similar rule to prevent dirtyness from being checked.
https://github.com/umbraco/Umbraco-CMS/blob/5ce9a3e74f3b8470430298db5f00e4212b95619e/src/Umbraco.Web.UI.Client/src/common/directives/components/property/umbpropertyeditor.directive.js
I did see this forum post
https://our.umbraco.com/forum/umbraco-8/98277-how-to-stop-you-have-unsaved-changes-message
and the suggestion to set the form as being pristine when it's saved?
regards
Marc
Thanks for your reply :)
I have tried
but currForm are alway null...
I could just save the node when then post a comment.
with this:
But getting this error:
Need to add
content.variants[0].save = true;
Hmm but the Unsaved changes modal are still coming. But the page saved succesfully.. strange...
The Unsaved changes modal only appears if the form is 'dirty'...
if you are working in a custom dashboard, then saving the item won't know to mark your form undirty
if you look in dev tools, you'll see the dirty class appear on your form entry when you start editing in the field, and see that it remains even when you save.
setPristine(); is probably the correct thing to do here
but it's getting a reference to your dashboard form that appears to be the challenge!
There is an example from a post, referenced from the other forum post:
would that approach get you your form and allow you to call setPristine(); ?
regards
Marc
I can see the form gets the class ng-dirty :)
Yes can't catch the form...
This
is just giving med this.. Cannot read property 'contentForm' of undefined
Yes it will need to be the name of your form? presume that is commentForm?
https://docs.angularjs.org/api/ng/function/angular.element
but I'm not sure why it's not finding it or if it is finding it, why .scope is undefined... frustrating because I reckon calling setPristine would get rid of the ng-dirty css class and then the un saved changes dialog wouldn't be triggered...
Can get the element with
angular.element('ng-form[name=commentForm]')
but the .scope() still gives an undefined...is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.