v1.18.x
Barış Soner Uşaklı 10 years ago
parent 33723f8b1b
commit 4d45a81fdb

@ -89,11 +89,9 @@ $(document).ready(function() {
app.previousUrl = url; app.previousUrl = url;
return ajaxify.go('login'); return ajaxify.go('login');
} else if (status === 302) { } else if (status === 302) {
if (data.responseJSON.path) { if (data.responseJSON.external && data.responseJSON.path) {
if (!ajaxify.go(data.responseJSON.path, callback, quiet)) { window.location.href = data.responseJSON.path;
window.location.href = data.responseJSON.path; } else if (typeof data.responseJSON === 'string') {
}
} else if (data.responseJSON) {
ajaxify.go(data.responseJSON.slice(1), callback, quiet); ajaxify.go(data.responseJSON.slice(1), callback, quiet);
} }
} }
@ -184,6 +182,9 @@ $(document).ready(function() {
} }
}, },
error: function(data, textStatus) { error: function(data, textStatus) {
if (data.status === 0 && textStatus === 'error') {
data.status = 500;
}
callback({ callback({
data: data, data: data,
textStatus: textStatus textStatus: textStatus
@ -264,5 +265,6 @@ $(document).ready(function() {
ajaxifyAnchors(); ajaxifyAnchors();
app.load(); app.load();
templates.cache['500'] = $('.tpl-500').html();
}); });

@ -1,7 +1,7 @@
<div class="alert alert-danger"> <div class="alert alert-danger">
<strong>[[global:500.title]]</strong> <strong>[[global:500.title]]</strong>
<p>[[global:500.message]]</p> <p>[[global:500.message]]</p>
<p>{path}<p> <p>{path}</p>
<!-- IF error --><p>{error}</p><!-- ENDIF error --> <!-- IF error --><p>{error}</p><!-- ENDIF error -->
</div> </div>
Loading…
Cancel
Save