- /**
- * @inheritdoc
- */
- sync: function () {
- // We don't use REST updates to sync.
- return;
- }
-
- }, /** @lends Drupal.quickedit.EntityModel */{
-
- /**
- * Sequence of all possible states an entity can be in during quickediting.
- *
- * @type {Array.<string>}
- */
- states: [
- // Initial state, like field's 'inactive' OR the user has just finished
- // in-place editing this entity.
- // - Trigger: none (initial) or EntityModel (finished).
- // - Expected behavior: (when not initial state): tear down
- // EntityToolbarView, in-place editors and related views.
- 'closed',
- // User has activated in-place editing of this entity.
- // - Trigger: user.
- // - Expected behavior: the EntityToolbarView is gets set up, in-place
- // editors (EditorViews) and related views for this entity's fields are
- // set up. Upon completion of those, the state is changed to 'opening'.
- 'launching',
- // Launching has finished.
- // - Trigger: application.
- // - Guarantees: in-place editors ready for use, all entity and field
- // views have been set up, all fields are in the 'inactive' state.
- // - Expected behavior: all fields are changed to the 'candidate' state
- // and once this is completed, the entity state will be changed to
- // 'opened'.
- 'opening',
- // Opening has finished.
- // - Trigger: EntityModel.
- // - Guarantees: see 'opening', all fields are in the 'candidate' state.
- // - Expected behavior: the user is able to actually use in-place editing.
- 'opened',
- // User has clicked the 'Save' button (and has thus changed at least one
- // field).
- // - Trigger: user.
- // - Guarantees: see 'opened', plus: either a changed field is in
- // PrivateTempStore, or the user has just modified a field without
- // activating (switching to) another field.
- // - Expected behavior: 1) if any of the fields are not yet in
- // PrivateTempStore, save them to PrivateTempStore, 2) if then any of
- // the fields has the 'invalid' state, then change the entity state back
- // to 'opened', otherwise: save the entity by committing it from
- // PrivateTempStore into permanent storage.
- 'committing',
- // User has clicked the 'Close' button, or has clicked the 'Save' button
- // and that was successfully completed.
- // - Trigger: user or EntityModel.
- // - Guarantees: when having clicked 'Close' hardly any: fields may be in
- // a variety of states; when having clicked 'Save': all fields are in
- // the 'candidate' state.
- // - Expected behavior: transition all fields to the 'candidate' state,
- // possibly requiring confirmation in the case of having clicked
- // 'Close'.
- 'deactivating',
- // Deactivation has been completed.
- // - Trigger: EntityModel.
- // - Guarantees: all fields are in the 'candidate' state.
- // - Expected behavior: change all fields to the 'inactive' state.
- 'closing'
- ],
-
- /**
- * Indicates whether the 'from' state comes before the 'to' state.
- *
- * @param {string} from
- * One of {@link Drupal.quickedit.EntityModel.states}.
- * @param {string} to
- * One of {@link Drupal.quickedit.EntityModel.states}.
- *
- * @return {bool}
- * Whether the 'from' state comes before the 'to' state.
- */
- followsStateSequence: function (from, to) {