'use strict';
/**
* Licensed Materials - Property of IBM
* IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2018
* US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/
define(['../../lib/@waca/dashboard-common/dist/ui/dialogs/BaseDialog', 'ca-modeller/shaping', '../nls/StringResources', 'jquery'], function (BaseDialog, Shaping, StringResources, $) {
'use strict';
var Dialog = BaseDialog.extend({
_buttons: ['close'],
_showCloseX: true,
init: function init(options) {
this.context = options.context;
this.selection = options.selection;
Dialog.inherited('init', this, arguments);
},
renderContent: function renderContent(n) {
var maxHeight = window.innerHeight - 250; //Prevent the dialog from exceeding the current window bounds.
this.$container = $('
', { 'class': 'dataSources paneContainer' }).css({ 'max-height': maxHeight }).appendTo(n);
if (this.context) {
try {
var dashboardApi = this.context.glassContext.appController.getCurrentContentView().getDashboardApi();
var showEditLabel = dashboardApi.getAppConfig('editPropertiesLabel');
this.context.shapingHelper.render(Shaping.ShapingProperties, { moserObjects: this.selection, showEditLabel: showEditLabel }, this.$container[0]);
} catch (e) {
/* Swallow exceptions for now as they don't always prevent the pane from rendering. */
}
}
return n;
},
renderTitle: function renderTitle(n) {
n.text(StringResources.get('propertiesDialogTitle'));
return n;
},
cancel: function cancel() {
this.context.shapingHelper.unmountComponentAtNode(this.$container[0]);
Dialog.inherited('cancel', this, arguments);
}
});
return Dialog;
});
//# sourceMappingURL=SourceMemberPropertiesDialog.js.map