12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- 'use strict';
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: BI Dashboard
- *| (C) Copyright IBM Corp. 2019
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- /**
- * Event helper class
- **/
- define([], function () {
- var ContentUtil = function () {
- function ContentUtil() {
- _classCallCheck(this, ContentUtil);
- }
- /**
- * Recursively walk the content and it's parent to find the page content.
- * @param {ContentAPI} content
- * @param {String} [type='page'] the content type.
- * @returns {ContentAPI} page content. If the type can not be found, returns null
- */
- ContentUtil.getPageContent = function getPageContent(content) {
- var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'page';
- var pageContent = null;
- while (content) {
- if (type && content.getType() === type) {
- pageContent = content;
- }
- content = content.getContainer();
- }
- return pageContent;
- };
- return ContentUtil;
- }();
- return ContentUtil;
- });
- //# sourceMappingURL=ContentUtil.js.map
|