SourceMemberPropertiesDialog.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. 'use strict';
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2018
  5. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. */
  7. define(['../../lib/@waca/dashboard-common/dist/ui/dialogs/BaseDialog', 'ca-modeller/shaping', '../nls/StringResources', 'jquery'], function (BaseDialog, Shaping, StringResources, $) {
  8. 'use strict';
  9. var Dialog = BaseDialog.extend({
  10. _buttons: ['close'],
  11. _showCloseX: true,
  12. init: function init(options) {
  13. this.context = options.context;
  14. this.selection = options.selection;
  15. Dialog.inherited('init', this, arguments);
  16. },
  17. renderContent: function renderContent(n) {
  18. var maxHeight = window.innerHeight - 250; //Prevent the dialog from exceeding the current window bounds.
  19. this.$container = $('<div>', { 'class': 'dataSources paneContainer' }).css({ 'max-height': maxHeight }).appendTo(n);
  20. if (this.context) {
  21. try {
  22. var dashboardApi = this.context.glassContext.appController.getCurrentContentView().getDashboardApi();
  23. var showEditLabel = dashboardApi.getAppConfig('editPropertiesLabel');
  24. this.context.shapingHelper.render(Shaping.ShapingProperties, { moserObjects: this.selection, showEditLabel: showEditLabel }, this.$container[0]);
  25. } catch (e) {
  26. /* Swallow exceptions for now as they don't always prevent the pane from rendering. */
  27. }
  28. }
  29. return n;
  30. },
  31. renderTitle: function renderTitle(n) {
  32. n.text(StringResources.get('propertiesDialogTitle'));
  33. return n;
  34. },
  35. cancel: function cancel() {
  36. this.context.shapingHelper.unmountComponentAtNode(this.$container[0]);
  37. Dialog.inherited('cancel', this, arguments);
  38. }
  39. });
  40. return Dialog;
  41. });
  42. //# sourceMappingURL=SourceMemberPropertiesDialog.js.map