mirror of
https://github.com/ansible/awx.git
synced 2026-04-23 02:35:23 -02:30
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:
@@ -9,7 +9,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<span class="HostEvent-title">{{event.host_name}}</span>
|
<span class="HostEvent-title">{{event.host_name}}</span>
|
||||||
<!-- close -->
|
<!-- close -->
|
||||||
<button ui-sref="jobDetail" type="button" class="close">
|
<button ng-click="closeHostEvent()" type="button" class="close">
|
||||||
<i class="fa fa-times-circle"></i>
|
<i class="fa fa-times-circle"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
<!-- controls -->
|
<!-- controls -->
|
||||||
<div class="HostEvent-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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -45,6 +45,12 @@
|
|||||||
return $scope.hostResults.indexOf(result[0]);
|
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(){
|
var init = function(){
|
||||||
hostEvent.event_name = hostEvent.event;
|
hostEvent.event_name = hostEvent.event;
|
||||||
$scope.event = _.cloneDeep(hostEvent);
|
$scope.event = _.cloneDeep(hostEvent);
|
||||||
@@ -98,6 +104,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$('#HostEvent').modal('show');
|
$('#HostEvent').modal('show');
|
||||||
|
|
||||||
|
$('#HostEvent').on('hidden.bs.modal', function () {
|
||||||
|
$scope.closeHostEvent();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
init();
|
init();
|
||||||
}];
|
}];
|
||||||
|
|||||||
Reference in New Issue
Block a user