123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- '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 {
- init: function init(model, spec /*, boardModel, logger*/) {
- if (spec.hasOverview && typeof spec.showOverviews === 'undefined') {
- var defaultSpec = {
- showStart: true,
- showEnd: true
- };
- model.showOverviews = spec.showOverviews = defaultSpec;
- }
- },
- /**
- * Update the showOverviews property of a model. This function will merge the provided showOverviews with the existing ones
- * @param model LayoutModel instance to update
- * @param showOverviews - object containing the showOverviews that we would like to update
- * @returns a payload useful to the LayoutMmodel._callExtensionMethod method
- */
- update: function update(model, showOverviews) {
- if (!showOverviews) {
- return null;
- }
- if (!model.showOverviews) {
- model.showOverviews = {};
- }
- var prev = _.clone(model.showOverviews);
- _.extend(model.showOverviews, showOverviews);
- return {
- event: 'change:showOverviews',
- value: showOverviews,
- previousValue: prev
- };
- }
- };
- });
- //# sourceMappingURL=LayoutModelShowOverviews.js.map
|