12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- 'use strict';
- 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; };
- define(['../../../../lib/@waca/dashboard-common/dist/core/Model'], function (Model) {
- var PropertiesModel = Model.extend({
- init: function init() {
- var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- PropertiesModel.inherited('init', this, arguments);
-
-
- for (var property in model) {
- this.whitelistAttrs.push(property);
- }
- },
- setPropertyValue: function setPropertyValue(propertyName, propertyValue, options) {
-
- if (this.whitelistAttrs.indexOf(propertyName) === -1) {
- this.whitelistAttrs.push(propertyName);
- }
- var payload = {};
-
- payload[propertyName] = propertyValue && (typeof propertyValue === 'undefined' ? 'undefined' : _typeof(propertyValue)) === 'object' ? JSON.parse(JSON.stringify(propertyValue)) : propertyValue;
- this.set(payload, options);
- },
- getPropertyValue: function getPropertyValue(propertyName) {
- var value = this.get(propertyName);
- if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {
-
-
- value = JSON.parse(JSON.stringify(value));
- }
- return value;
- }
- });
- return PropertiesModel;
- });
|