mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 22:28:51 +01:00
Enh #3939: Add client.redirect
action to client js module
This commit is contained in:
parent
360effe1f2
commit
766ef3b7bd
@ -318,7 +318,17 @@ humhub.module('client', function (module, require, $) {
|
||||
url = xhr.getResponseHeader('X-Redirect');
|
||||
}
|
||||
|
||||
if (url !== null) {
|
||||
redirect(url);
|
||||
};
|
||||
|
||||
var redirect = function(url) {
|
||||
if(!url) {
|
||||
return;
|
||||
}
|
||||
|
||||
url = object.isString(url) ? url : url.url;
|
||||
|
||||
if (object.isString(url)) {
|
||||
if(module.pjax && module.pjax.config.active) {
|
||||
module.pjax.redirect(url);
|
||||
} else {
|
||||
@ -419,10 +429,11 @@ humhub.module('client', function (module, require, $) {
|
||||
reload: reload,
|
||||
submit: submit,
|
||||
init: init,
|
||||
sortOrder: 100,
|
||||
json: json,
|
||||
Response: Response,
|
||||
onBeforeLoad: onBeforeLoad,
|
||||
offBeforeLoad: offBeforeLoad
|
||||
|
||||
offBeforeLoad: offBeforeLoad,
|
||||
redirect: redirect
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user