By tracking the fieldsets that have been expanded (loaded), we can make
sure the submit watchers fire appropriately, even when the fieldsets are
collapsed down again.
Apart from hopefully fixing the publishing issues for collapsed
fieldsets, this also adds a performance gain if the users expand and
collapse the same fieldsets more than once, since the fieldsets now only
load the first time they're expanded (instead of every time).
This also - at least partially - fixes the validation issue #325
introduced by #301
Because of the lazy loading of property editors, the
submitWatcherOnSubmit method is not necessarily called when an Archetype
is saved. This is indeed the case when all fieldsets are collapsed.
Add a watch to the "formSubmitting" event for each property added to a
fieldset, to make sure Archetype gets the last say in the
"formSubmitting" event.
Allow fieldset label templates to contain alternative/fallback property
aliases and/or functions by seperating with "|" - e.g.
{{title|myFunction(text)}}
The fieldset.isValid property isn't necessarily initialized when the
view looks for it to determine fieldset validity. I've introduced a
validation method that counters this problem.
The validation method also ensures that any validation errors in nested
Archetypes are highlighted on the parent/root Archetype
Old: archetype-property-<umbracoPropertyAlias>-<fieldsetIndex>-<propertyIndex>
New: archetype-property-<umbracoPropertyAlias>-<archetypePropertyAlias>-<fieldsetIndex>
Basically, this adds the archetypePropertyAlias into the mix, to fix a case where you might have the same Archetype nested on a host Archetype twice (ie box 1 links, box 2 links within the same Archetype - there was no uniqueness)
It also adds in the Property Alias in place of the Property "Index" (unintended side effect, but seems cool :))