EditorModel.es6.js 1.1 KB

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