1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- "use strict";
- /**
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: admin
- *
- * Copyright IBM Corp. 2016
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['bi/commons/ui/dialogs/GenericViewDialog', 'bi/admin/nls/StringResource'], function (BaseDialog, StringResource) {
- /**
- * Create a error dialog that will display a list of errors.
- *
- * @param - options
- * {
- * errorList: Array of errors to display
- * }
- *
- */
- var SimpleDialog = BaseDialog.extend({
- init: function init(options) {
- this.options = options;
- var dialogOptions = {
- 'buttons': ['ok'],
- 'viewClass': options.viewObject,
- 'id': 'SimpleDialog',
- 'title': options.title,
- 'viewOptions': {
- 'displayMsgList': this.options.displayMsgList,
- 'onOpen': this.onOpen.bind(this),
- 'glassContext': this.options.glassContext
- }
- };
- SimpleDialog.inherited('init', this, [dialogOptions]);
- },
- /**
- * Called when the dialog is opened
- */
- onOpen: function onOpen() {
- var container = this._container();
- container.addClass('openDialog');
- container.find('.dialogHeader');
- container.find('.modalDialog').addClass('contentListDialog');
- container.find('footer').attr('role', 'contentinfo').attr('aria-label', StringResource.get('ok'));
- },
- /**
- * Called when the OK button is clicked
- */
- ok: function ok() {
- this.hide();
- },
- setFocus: function setFocus() {
- this._container().find('.dialogButton.primary')[0].focus();
- }
- });
- return SimpleDialog;
- });
|