comparison core/modules/quickedit/js/models/BaseModel.js @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 /**
2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
5 * @preserve
6 **/
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; };
8
9 (function (Drupal, Backbone) {
10 Drupal.quickedit.BaseModel = Backbone.Model.extend({
11 initialize: function initialize(options) {
12 this.__initialized = true;
13 return Backbone.Model.prototype.initialize.call(this, options);
14 },
15 set: function set(key, val, options) {
16 if (this.__initialized) {
17 if ((typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'object') {
18 key.validate = true;
19 } else {
20 if (!options) {
21 options = {};
22 }
23 options.validate = true;
24 }
25 }
26 return Backbone.Model.prototype.set.call(this, key, val, options);
27 }
28 });
29 })(Drupal, Backbone);