javascript to redirect to the course being accessed

This commit is contained in:
John Jarvis
2013-02-19 20:42:38 -05:00
parent fd36c555a6
commit 2a6fde9db2

View File

@@ -33,15 +33,20 @@
<script type="text/javascript">
(function() {
$(document).delegate('#login-form', 'ajax:success', function(data, json, xhr) {
if(json.success) {
location.href="${reverse('dashboard')}";
$(document).delegate('#login-form', 'ajax:success', function(data, json, xhr) {
if(json.success) {
var u=decodeURI(window.location.search);
next=u.split("next=")[1]
if (next) {
location.href=next
} else {
location.href="${reverse('dashboard')}";
}
}
});
})(this)
</script>
</%block>
<section class="login container">