'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** * Licensed Materials - Property of IBM * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2019 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ /** * @class PageContent * @classdesc This Content child class exists to abstract away the genericPage layout from contents of the page type. Objects of this class are created by the PageContentProvider. */ define(['./Content'], function (Content) { var PageContent = function (_Content) { _inherits(PageContent, _Content); function PageContent() { _classCallCheck(this, PageContent); return _possibleConstructorReturn(this, _Content.apply(this, arguments)); } PageContent.prototype.getType = function getType() { return 'page'; }; PageContent.prototype.getChildren = function getChildren() { var _this2 = this; var genericPage = this.layoutModel.items[0]; if (genericPage.items) { return genericPage.items.map(function (item) { return _this2.getContent(item.id); }); } else { return []; } }; PageContent.prototype.addContent = function addContent(content) { var _Content$prototype$ad; if (content.containerId === this.layoutModel.id) { content.containerId = this.layoutModel.items[0].id; } return (_Content$prototype$ad = _Content.prototype.addContent).call.apply(_Content$prototype$ad, [this].concat(Array.prototype.slice.call(arguments))); }; PageContent.prototype.moveContent = function moveContent(containerId, contentIdList, transactionToken) { containerId = this.layoutModel.items[0].id; return _Content.prototype.moveContent.call(this, containerId, contentIdList, transactionToken); }; return PageContent; }(Content); return PageContent; }); //# sourceMappingURL=PageContent.js.map