2019-04-24 14:31:01 +02:00
|
|
|
import {Component} from '@angular/core';
|
2017-12-19 13:53:46 +01:00
|
|
|
import {ActivatedRoute, Router} from '@angular/router';
|
|
|
|
import {Session} from '../login/utils/helper.class';
|
2019-04-24 14:31:01 +02:00
|
|
|
import {HelperFunctions} from "../utils/HelperFunctions.class";
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'reload',
|
|
|
|
template: `
|
|
|
|
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" >
|
|
|
|
<div uk-grid uk-grid>
|
|
|
|
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
|
|
|
|
<div class="uk-container uk-margin-top publication">
|
|
|
|
Go to initial page....
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
export class ReloadComponent {
|
|
|
|
|
2019-04-24 14:31:01 +02:00
|
|
|
constructor (private route: ActivatedRoute, private _router: Router) {}
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
public ngOnInit() {
|
2019-04-24 14:31:01 +02:00
|
|
|
HelperFunctions.scroll();
|
|
|
|
|
2018-05-23 16:47:27 +02:00
|
|
|
var URL = Session.getReloadUrl();
|
2018-06-29 13:01:48 +02:00
|
|
|
|
|
|
|
if(URL && URL["path"] && URL["path"] != null && URL["path"] != ""){
|
|
|
|
var url = URL["path"];
|
2018-05-23 16:47:27 +02:00
|
|
|
var host = URL["host"];
|
2018-07-02 15:42:20 +02:00
|
|
|
var paramsObject = ((URL["params"] && URL["params"] != null)? Session.getParamsObj(URL["params"]):null);
|
2018-06-01 14:28:49 +02:00
|
|
|
if(host == (location.protocol+"//"+location.host)){
|
2018-05-23 16:47:27 +02:00
|
|
|
if(paramsObject && paramsObject != null){
|
|
|
|
Session.setReloadUrl("","","")
|
|
|
|
this._router.navigate([url],{ queryParams: paramsObject});
|
|
|
|
}else{
|
|
|
|
Session.setReloadUrl("","","")
|
|
|
|
this._router.navigate([url]);
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
}else{
|
2018-05-23 16:47:27 +02:00
|
|
|
Session.setReloadUrl("","","")
|
2018-07-02 15:42:20 +02:00
|
|
|
window.location.href = host+url+((URL["params"] && URL["params"] !=null)?((URL["params"].indexOf("?")==-1?"?":"")+URL["params"]):"");
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2018-05-23 16:47:27 +02:00
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
}else{
|
2018-05-23 16:47:27 +02:00
|
|
|
Session.setReloadUrl("","","")
|
2017-12-19 13:53:46 +01:00
|
|
|
this._router.navigate(['/']);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|