this.set('isActive', true);
break;
- case 'committing':
+ case 'committing': {
// The user indicated they want to save the entity.
- var fields = this.get('fields');
+ const fields = this.get('fields');
// For fields that are in an active state, transition them to
// candidate.
fields.chain()
fieldModel.set('state', 'saving');
});
break;
+ }
- case 'deactivating':
- var changedFields = this.get('fields')
+ case 'deactivating': {
+ const changedFields = this.get('fields')
.filter(fieldModel => _.intersection([fieldModel.get('state')], ['changed', 'invalid']).length);
// If the entity contains unconfirmed or unsaved changes, return the
// entity to an opened state and ask the user if they would like to
});
}
break;
+ }
case 'closing':
// Set all fields to the 'inactive' state.
}
break;
- case 'committing':
+ case 'committing': {
// If the field save returned a validation error, set the state of the
// entity back to 'opened'.
if (fieldState === 'invalid') {
// Attempt to save the entity. If the entity's fields are not yet all
// in a ready state, the save will not be processed.
- var options = {
+ const options = {
'accept-field-states': Drupal.quickedit.app.readyFieldStates,
};
if (entityModel.set('isCommitting', true, options)) {
});
}
break;
+ }
case 'deactivating':
// When setting the entity to 'closing', require that all fieldModels