Added Entity and Entity Reference Revisions which got dropped somewhere along the...
[yaffs-website] / web / core / modules / quickedit / js / models / EditorModel.es6.js
1 /**
2  * @file
3  * A Backbone Model for the state of an in-place editor.
4  *
5  * @see Drupal.quickedit.EditorView
6  */
7
8 (function(Backbone, Drupal) {
9   /**
10    * @constructor
11    *
12    * @augments Backbone.Model
13    */
14   Drupal.quickedit.EditorModel = Backbone.Model.extend(
15     /** @lends Drupal.quickedit.EditorModel# */ {
16       /**
17        * @type {object}
18        *
19        * @prop {string} originalValue
20        * @prop {string} currentValue
21        * @prop {Array} validationErrors
22        */
23       defaults: /** @lends Drupal.quickedit.EditorModel# */ {
24         /**
25          * Not the full HTML representation of this field, but the "actual"
26          * original value of the field, stored by the used in-place editor, and
27          * in a representation that can be chosen by the in-place editor.
28          *
29          * @type {string}
30          */
31         originalValue: null,
32
33         /**
34          * Analogous to originalValue, but the current value.
35          *
36          * @type {string}
37          */
38         currentValue: null,
39
40         /**
41          * Stores any validation errors to be rendered.
42          *
43          * @type {Array}
44          */
45         validationErrors: null,
46       },
47     },
48   );
49 })(Backbone, Drupal);