4b6177bc43fdb007930359539f071e6363246ad9
[yaffs-website] / web / core / modules / quickedit / js / models / EditorModel.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   'use strict';
11
12   /**
13    * @constructor
14    *
15    * @augments Backbone.Model
16    */
17   Drupal.quickedit.EditorModel = Backbone.Model.extend(/** @lends Drupal.quickedit.EditorModel# */{
18
19     /**
20      * @type {object}
21      *
22      * @prop {string} originalValue
23      * @prop {string} currentValue
24      * @prop {Array} validationErrors
25      */
26     defaults: /** @lends Drupal.quickedit.EditorModel# */{
27
28       /**
29        * Not the full HTML representation of this field, but the "actual"
30        * original value of the field, stored by the used in-place editor, and
31        * in a representation that can be chosen by the in-place editor.
32        *
33        * @type {string}
34        */
35       originalValue: null,
36
37       /**
38        * Analogous to originalValue, but the current value.
39        *
40        * @type {string}
41        */
42       currentValue: null,
43
44       /**
45        * Stores any validation errors to be rendered.
46        *
47        * @type {Array}
48        */
49       validationErrors: null
50     }
51
52   });
53
54 }(Backbone, Drupal));