Commit 5906327f authored by frjo's avatar frjo
Browse files

Issue #1171612 by ckng: Path to fix destination for login forms when Drupal is...

Issue #1171612 by ckng: Path to fix destination for login forms when Drupal is installed in an sub directory.
parent 270a3837
......@@ -9,13 +9,14 @@ Drupal.behaviors.initColorboxLogin = {
var path = this.href;
var new_path = path.replace(/user\/login/,'user/login/colorbox')
var addquery = (path.indexOf('?') !=-1) ? '&' : '?';
var dest = window.location.pathname.replace(Drupal.settings.basePath, '');
// If no destination, add one to the current page.
if (path.indexOf('destination') !=-1) {
if (path.indexOf('destination') != -1 || dest == '') {
this.href = new_path;
}
else {
this.href = new_path + addquery + 'destination=' + window.location.pathname.substr(1);
this.href = new_path + addquery + 'destination=' + dest;
}
}).colorbox({
initialWidth:200,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment