1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- 'use strict';
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2014, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['../../../lib/@waca/core-client/js/core-client/ui/dialogs/BaseDialog'], function (BaseDialog) {
- var Dialog = null;
- Dialog = BaseDialog.extend({
- _buttons: ['ok', 'cancel'],
- _okCallback: null,
- _cancelCallback: null,
- init: function init(options) {
- this.title = options.title;
- this.view = new options.viewClass(options.viewOptions);
- this._okCallback = options.okCallback;
- this._cancelCallback = options.cancelCallback;
- Dialog.inherited('init', this, arguments);
- },
- destroy: function destroy() {
- if (this.view) {
- this.view.remove();
- }
- Dialog.inherited('destroy', this, arguments);
- },
- renderContent: function renderContent(n) {
- this.view.render();
- n.append(this.view.$el);
- return n;
- },
- renderTitle: function renderTitle(n) {
- n.text(this.title);
- return n;
- },
- ok: function ok() {
- Dialog.inherited('ok', this, arguments);
- if (this._okCallback) {
- return this._okCallback();
- }
- },
- cancel: function cancel() {
- Dialog.inherited('cancel', this, arguments);
- if (this._cancelCallback) {
- return this._cancelCallback();
- }
- },
- open: function open() {
- Dialog.inherited('open', this, arguments);
- if (this.view.onOpen) {
- this.view.onOpen();
- }
- }
- });
- return Dialog;
- });
- //# sourceMappingURL=GenericViewDialog.js.map
|