v1.18.x
Baris Usakli 11 years ago
parent fe6595cd2a
commit f2c1a92513

@ -111,9 +111,10 @@ var ajaxify = {};
return href == 'javascript:;' || href == window.location.href + "#" || href.slice(-1) === "#"; return href == 'javascript:;' || href == window.location.href + "#" || href.slice(-1) === "#";
} }
if (hrefEmpty(this.href)) return; if (hrefEmpty(this.href) || this.target !== '' || this.protocol === 'javascript:')
if (this.target !== '') return; return;
if (this.protocol === 'javascript:') return;
app.previousUrl = window.location.href;
if (!e.ctrlKey && e.which === 1) { if (!e.ctrlKey && e.which === 1) {
if (this.host === window.location.host) { if (this.host === window.location.host) {
@ -121,6 +122,7 @@ var ajaxify = {};
var url = this.href.replace(rootUrl + '/', ''); var url = this.href.replace(rootUrl + '/', '');
if (ajaxify.go(url)) { if (ajaxify.go(url)) {
e.preventDefault(); e.preventDefault();
} }
} else if (window.location.pathname !== '/outgoing') { } else if (window.location.pathname !== '/outgoing') {

@ -11,6 +11,8 @@
validationError = false, validationError = false,
successIcon = '<i class="icon icon-ok"></i>'; successIcon = '<i class="icon icon-ok"></i>';
$('#referrer').val(app.previousUrl);
function showError(element, msg) { function showError(element, msg) {
element.html(msg); element.html(msg);
element.parent() element.parent()

@ -65,6 +65,7 @@
</div> </div>
</div> </div>
<input type="hidden" name="_csrf" value="{token}" /> <input type="hidden" name="_csrf" value="{token}" />
<input id="referrer" type="hidden" name="referrer" value="" />
</form> </form>
</div> </div>
</div> </div>

@ -183,6 +183,9 @@
req.login({ req.login({
uid: uid uid: uid
}, function() { }, function() {
if(req.body.referrer)
res.redirect(req.body.referrer);
else
res.redirect(nconf.get('relative_path') + '/'); res.redirect(nconf.get('relative_path') + '/');
}); });
} else { } else {

Loading…
Cancel
Save