Merge pull request #5921 from mabashian/5895-job-results-modal

Navigate back to the jobDetails state when the user clicks outside the host event modal.
This commit is contained in:
Michael Abashian 2017-03-29 14:29:19 -04:00 committed by GitHub
commit 64d2d6970b
2 changed files with 12 additions and 2 deletions

View File

@ -9,7 +9,7 @@
</a>
<span class="HostEvent-title">{{event.host_name}}</span>
<!-- close -->
<button ui-sref="jobDetail" type="button" class="close">
<button ng-click="closeHostEvent()" type="button" class="close">
<i class="fa fa-times-circle"></i>
</button>
</div>
@ -64,7 +64,7 @@
<!-- controls -->
<div class="HostEvent-controls">
<button ui-sref="jobDetail" class="btn btn-sm btn-default HostEvent-close">Close</button>
<button ng-click="closeHostEvent()" class="btn btn-sm btn-default HostEvent-close">Close</button>
</div>
</div>
</div>

View File

@ -45,6 +45,12 @@
return $scope.hostResults.indexOf(result[0]);
};
$scope.closeHostEvent = function() {
// Unbind the listener so it doesn't fire when we close the modal via navigation
$('#HostEvent').off('hidden.bs.modal');
$state.go('jobDetail');
};
var init = function(){
hostEvent.event_name = hostEvent.event;
$scope.event = _.cloneDeep(hostEvent);
@ -98,6 +104,10 @@
}
}
$('#HostEvent').modal('show');
$('#HostEvent').on('hidden.bs.modal', function () {
$scope.closeHostEvent();
});
};
init();
}];