123456789101112131415161718192021222324252627282930313233343536 |
- 'use strict';
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Storytelling
- * (C) Copyright IBM Corp. 2017, 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['underscore'], function (_) {
- return {
- /**
- * Update the data property of a model. This function will merge the provided data with the existing ones
- * @param model LayoutModel instance to update
- * @param data object containing the data that we would like to update
- * @returns a payload useful to the LayoutMmodel._callExtensionMethod method
- */
- update: function update(model, data) {
- if (!data) {
- return null;
- }
- if (!model.data) {
- model.data = {};
- }
- var prev = _.clone(model.data);
- _.extend(model.data, data);
- return {
- event: 'change:data',
- value: data,
- previousValue: prev
- };
- }
- };
- });
- //# sourceMappingURL=LayoutModelData.js.map
|