Skip to content
Snippets Groups Projects
Commit 17a4dc09 authored by jaden's avatar jaden
Browse files

rm modalService, unused

parent fd7c34b1
No related branches found
No related tags found
1 merge request!223Reports overhaul
/*
* Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
* Contact: beat.support@idiap.ch
*
* This file is part of the beat.web module of the BEAT platform.
*
* Commercial License Usage
* Licensees holding valid commercial BEAT licenses may use this file in
* accordance with the terms contained in a written agreement between you
* and Idiap. For further information contact tto@idiap.ch
*
* Alternatively, this file may be used under the terms of the GNU Affero
* Public License version 3 as published by the Free Software and appearing
* in the file LICENSE.AGPL included in the packaging of this file.
* The BEAT platform is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero Public License along
* with the BEAT platform. If not, see http://www.gnu.org/licenses/.
*/
/*
* ModalService
* Desc:
* Manages the "global" reports app modal (content, etc.)
*/
angular.module('reportApp').factory('ModalService', [function(){
const ms = {
_title: '',
_content: '',
_buttonCancelText: '',
_buttonCancelFunc: () => {},
_buttonSubmitText: null,
_buttonSubmitFunc: () => {},
_modalId: 'reportModal'
};
// activates the modal, with an optional shortcut for specifying title & content text
ms.activateModal = (title, content) => {
if(ms._modalId.length > 0){
ms.setModalData(title, content);
return $(`#${ms._modalId}`).modal();
} else {
}
};
// sets the modal title & content
ms.setModalData = (titleStr, contentStr) => {
ms._title = titleStr || ms._title;
ms._content = contentStr || ms._content;
};
// sets the cancel button text & action
ms.setModalCancelData = (text, func) => {
ms._buttonCancelText = text && text.length > 0 ? text : 'Close';
ms._buttonCancelFunc = func ? func : () => {};
};
// sets the submit button text & action
ms.setModalSubmitData = (text, func) => {
ms._buttonSubmitText = text && text.length > 0 ? text : null;
ms._buttonSubmitFunc = func ? func : () => {};
};
return ms;
}]);
......@@ -90,7 +90,6 @@
<script src="{% fingerprint "reports/app/services/urlService.js" %}" type="text/javascript" charset="utf-8"></script>
<script src="{% fingerprint "reports/app/services/reportService.js" %}" type="text/javascript" charset="utf-8"></script>
<script src="{% fingerprint "reports/app/services/plotService.js" %}" type="text/javascript" charset="utf-8"></script>
<script src="{% fingerprint "reports/app/services/modalService.js" %}" type="text/javascript" charset="utf-8"></script>
<!-- directives -->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment