Skip to content

Commit

Permalink
Merge pull request #142 from TAMULib/error-report-modal
Browse files Browse the repository at this point in the history
open report error modal using service, static backdrop
  • Loading branch information
wwelling committed Jun 5, 2019
2 parents ebb1c01 + 0b55cc9 commit 6c7e07f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/controllers/abstractController.js
Expand Up @@ -166,7 +166,7 @@ core.controller('AbstractController', function ($scope, $window, ModalService, S
method: 'error',
data: alert
}).then(function () {
$scope.closeModal();
$scope.openModal('#reportModal');
}, function (response) {
if (response.data === undefined || response.data.message !== "EXPIRED_JWT") {
var subject = 'Error Report';
Expand Down
12 changes: 6 additions & 6 deletions app/services/modalService.js
Expand Up @@ -2,17 +2,17 @@ core.service("ModalService", function () {

var ModalService = this;

ModalService.openModalId = undefined;
var modalElement;

ModalService.openModal = function (id) {
ModalService.openModalId = id;
angular.element(id).modal('show');
modalElement = angular.element(id);
modalElement.modal('show');
};

ModalService.closeModal = function () {
angular.element(ModalService.openModalId).modal('hide');
angular.element('body').removeClass('modal-open');
angular.element('.modal-backdrop').remove();
if (modalElement) {
modalElement.modal('hide');
}
};

return ModalService;
Expand Down
2 changes: 1 addition & 1 deletion app/views/alerts/defaultalert.html
@@ -1,4 +1,4 @@
<modal modal-id="reportModal" modal-view="node_modules/weaver-ui-core/app/views/modals/errorReportModal.html" modal-header-class="modal-header-primary"></modal>
<modal modal-id="reportModal" modal-view="node_modules/weaver-ui-core/app/views/modals/errorReportModal.html" modal-header-class="modal-header-primary" wvr-modal-backdrop="static"></modal>

<div class="alert alert-wrapper alert-{{alert.class}}" ng-class="{fade: alert.fade}" role="alert">
<button ng-click="remove(alert, true)" type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
Expand Down

0 comments on commit 6c7e07f

Please sign in to comment.