Chris@0: /** Chris@0: * @file Chris@0: * A Backbone Model for the state of an in-place editor. Chris@0: * Chris@0: * @see Drupal.quickedit.EditorView Chris@0: */ Chris@0: Chris@17: (function(Backbone, Drupal) { Chris@0: /** Chris@0: * @constructor Chris@0: * Chris@0: * @augments Backbone.Model Chris@0: */ Chris@17: Drupal.quickedit.EditorModel = Backbone.Model.extend( Chris@17: /** @lends Drupal.quickedit.EditorModel# */ { Chris@17: /** Chris@17: * @type {object} Chris@17: * Chris@17: * @prop {string} originalValue Chris@17: * @prop {string} currentValue Chris@17: * @prop {Array} validationErrors Chris@17: */ Chris@17: defaults: /** @lends Drupal.quickedit.EditorModel# */ { Chris@17: /** Chris@17: * Not the full HTML representation of this field, but the "actual" Chris@17: * original value of the field, stored by the used in-place editor, and Chris@17: * in a representation that can be chosen by the in-place editor. Chris@17: * Chris@17: * @type {string} Chris@17: */ Chris@17: originalValue: null, Chris@0: Chris@17: /** Chris@17: * Analogous to originalValue, but the current value. Chris@17: * Chris@17: * @type {string} Chris@17: */ Chris@17: currentValue: null, Chris@0: Chris@17: /** Chris@17: * Stores any validation errors to be rendered. Chris@17: * Chris@17: * @type {Array} Chris@17: */ Chris@17: validationErrors: null, Chris@17: }, Chris@0: }, Chris@17: ); Chris@17: })(Backbone, Drupal);