12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- 'use strict';
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Content Explorer
- *| (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(['jquery', '../../lib/@waca/core-client/js/core-client/ui/core/Class'], function ($, Class) {
- var SlideoutHelper = Class.extend({
- createAndShowSlideout: function createAndShowSlideout(slideoutSpec, context) {
- var _this = this;
- this._slideout = this.glassContext.appController.showSlideOut(slideoutSpec);
- this._slideout.$el.addClass('dashboardPane');
- // force a resize after we show/hide so that we can resize the visualizations
- var resize = function resize() {
- try {
- $(window).resize();
- } catch (e) {
- console.error(e);
- }
- };
- this._slideout.on('done:show', resize);
- this._slideout.on('hide', function () {
- _this._closeSlideout();
- if (context && context.target && context.target.plugin && context.target.plugin.setUnpressed) {
- context.target.plugin.setUnpressed();
- }
- resize();
- });
- },
- isSlideoutOpen: function isSlideoutOpen() {
- return this._slideout && this._slideout.isOpen();
- },
- _closeSlideout: function _closeSlideout() {
- if (!this._slideout) {
- return;
- }
- this._slideout.hide({
- force: true
- });
- delete this._slideout;
- },
- onHide: function onHide() {
- if (this.isSlideoutOpen()) {
- this._closeSlideout();
- }
- }
- });
- return SlideoutHelper;
- });
- //# sourceMappingURL=SlideoutHelper.js.map
|