mirror of https://github.com/docker/docs.git
Improve undefined error in EULA. (#17187)
Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
This commit is contained in:
parent
ad838307d7
commit
59bcc82aba
|
@ -190,11 +190,24 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Store the original modal body content in a variable
|
||||||
|
var originalModalBody = $('#accept-eula .modal-body').html();
|
||||||
|
|
||||||
function initAcceptEULAModal() {
|
function initAcceptEULAModal() {
|
||||||
$("main").on("click", "a.accept-eula", function (e) {
|
$("main").on("click", "a.accept-eula", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
_("#accept-eula .btn-primary").href = e.target.href;
|
// Check for undefined. Occurs when loaded via proxy.
|
||||||
$('#accept-eula').modal('show')
|
if (e.target.href && e.target.href !== 'undefined') {
|
||||||
|
$("#accept-eula .btn-primary").attr('href', e.target.href);
|
||||||
|
$('#accept-eula .modal-body').html(originalModalBody);
|
||||||
|
$("#accept-eula .btn-primary").show();
|
||||||
|
} else {
|
||||||
|
var errorMessage = 'Unable to process the download link. If you are using a proxy, like a translation service, try accessing the the page without using the proxy.';
|
||||||
|
$('#accept-eula .modal-body').html('<div class="alert alert-danger">' + errorMessage + '</div>');
|
||||||
|
$("#accept-eula .btn-primary").hide();
|
||||||
|
}
|
||||||
|
$('#accept-eula').modal('show');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue