X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fquickedit%2Fjs%2Fmodels%2FBaseModel.js;fp=web%2Fcore%2Fmodules%2Fquickedit%2Fjs%2Fmodels%2FBaseModel.js;h=c37eb921b6bbe088afb5227277b201cba7dcbf99;hp=7579b6f03b0d92de443eddb250b5be8fd611567a;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/quickedit/js/models/BaseModel.js b/web/core/modules/quickedit/js/models/BaseModel.js index 7579b6f03..c37eb921b 100644 --- a/web/core/modules/quickedit/js/models/BaseModel.js +++ b/web/core/modules/quickedit/js/models/BaseModel.js @@ -1,51 +1,22 @@ /** - * @file - * A Backbone Model subclass that enforces validation when calling set(). - */ +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ +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; }; (function (Drupal, Backbone) { - - 'use strict'; - - Drupal.quickedit.BaseModel = Backbone.Model.extend(/** @lends Drupal.quickedit.BaseModel# */{ - - /** - * @constructs - * - * @augments Backbone.Model - * - * @param {object} options - * Options for the base model- - * - * @return {Drupal.quickedit.BaseModel} - * A quickedit base model. - */ - initialize: function (options) { + Drupal.quickedit.BaseModel = Backbone.Model.extend({ + initialize: function initialize(options) { this.__initialized = true; return Backbone.Model.prototype.initialize.call(this, options); }, - - /** - * Set a value on the model - * - * @param {object|string} key - * The key to set a value for. - * @param {*} val - * The value to set. - * @param {object} [options] - * Options for the model. - * - * @return {*} - * The result of `Backbone.Model.prototype.set` with the specified - * parameters. - */ - set: function (key, val, options) { + set: function set(key, val, options) { if (this.__initialized) { - // Deal with both the "key", value and {key:value}-style arguments. - if (typeof key === 'object') { + if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object') { key.validate = true; - } - else { + } else { if (!options) { options = {}; } @@ -54,7 +25,5 @@ } return Backbone.Model.prototype.set.call(this, key, val, options); } - }); - -}(Drupal, Backbone)); +})(Drupal, Backbone); \ No newline at end of file