'use strict'; /** * An extension of a MessageBox to provide a confirmation dialog * * Licensed Materials - Property of IBM IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2014 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/MessageBox'], function (MessageBox) { var Dialog = null; Dialog = MessageBox.extend({ _buttons: ['ok', 'cancel'], _confirmCallback: null, _cancelCallback: null, /** * Opens the Confirmation dialog * @param {function} confirm - A callback to use when the user clicks OK * @param {function} cancel - A callback to use when the user clicks Cancel */ confirm: function confirm(_confirm, cancel) { this._confirmCallback = _confirm; this._cancelCallback = cancel; Dialog.inherited('open', this); }, ok: function ok() { Dialog.inherited('ok', this, arguments); if (this._confirmCallback) { this._confirmCallback(); } }, cancel: function cancel() { Dialog.inherited('cancel', this, arguments); if (this._cancelCallback) { this._cancelCallback(); } } }); return Dialog; }); //# sourceMappingURL=ConfirmationDialog.js.map