Mercurial > hg > isophonics-drupal-site
annotate core/modules/quickedit/js/models/BaseModel.js @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 /** |
Chris@0 | 2 * DO NOT EDIT THIS FILE. |
Chris@0 | 3 * See the following change record for more information, |
Chris@0 | 4 * https://www.drupal.org/node/2815083 |
Chris@0 | 5 * @preserve |
Chris@0 | 6 **/ |
Chris@0 | 7 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; |
Chris@0 | 8 |
Chris@0 | 9 (function (Drupal, Backbone) { |
Chris@0 | 10 Drupal.quickedit.BaseModel = Backbone.Model.extend({ |
Chris@0 | 11 initialize: function initialize(options) { |
Chris@0 | 12 this.__initialized = true; |
Chris@0 | 13 return Backbone.Model.prototype.initialize.call(this, options); |
Chris@0 | 14 }, |
Chris@0 | 15 set: function set(key, val, options) { |
Chris@0 | 16 if (this.__initialized) { |
Chris@0 | 17 if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object') { |
Chris@0 | 18 key.validate = true; |
Chris@0 | 19 } else { |
Chris@0 | 20 if (!options) { |
Chris@0 | 21 options = {}; |
Chris@0 | 22 } |
Chris@0 | 23 options.validate = true; |
Chris@0 | 24 } |
Chris@0 | 25 } |
Chris@0 | 26 return Backbone.Model.prototype.set.call(this, key, val, options); |
Chris@0 | 27 } |
Chris@0 | 28 }); |
Chris@0 | 29 })(Drupal, Backbone); |