field-engineer icon indicating copy to clipboard operation
field-engineer copied to clipboard

Delete / Save

Open H-i-red opened this issue 7 years ago • 2 comments

If you delete a field and leave the page without saving, the field will still be there. It should not be there and the sign "You have unsaved changes" should be visible.

H-i-red avatar Sep 10 '17 16:09 H-i-red

well I digged around your JS code and found that you do not "keep" the state when you "DELETE/SORT/CLONE" an entry/module, if you trigger it in your render function everything works.. : obj.closest('form').trigger('keep');

fn.render = function(obj) {
		var output = '';
		var fields = obj.find('.egr-presentation').children();
		var out = '';
		var textarea = obj.find('.egr-output').find('textarea');
		out = fn.renderLoop(fields, out, level, true);
		textarea.val(out);
		textarea.blur();
		obj.closest('form').trigger('keep');
	};

H-i-red avatar Oct 01 '17 15:10 H-i-red

Nice digging! I'll try your fix to the next version. In the meantime, you can keep the fix in your code if it works well. Thanks!

jenstornell avatar Oct 03 '17 06:10 jenstornell