mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
create iframe view and fix preview map
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import { IframeModal } from "renderer/components/modal/modal-types/iframe-modal.component";
|
||||
import { Observable } from "rxjs";
|
||||
import { Subject } from "rxjs";
|
||||
import { IpcService } from "./ipc.service";
|
||||
import { ModalService } from "./modale.service";
|
||||
|
||||
export class LinkOpenerService{
|
||||
|
||||
private static instance: LinkOpenerService;
|
||||
|
||||
private readonly ipcService: IpcService;
|
||||
private readonly modals: ModalService;
|
||||
|
||||
private readonly _iframeLink$: Subject<string> = new Subject();
|
||||
|
||||
public static getInstance(): LinkOpenerService{
|
||||
if(!LinkOpenerService.instance){ LinkOpenerService.instance = new LinkOpenerService(); }
|
||||
@@ -16,15 +17,21 @@ export class LinkOpenerService{
|
||||
|
||||
private constructor(){
|
||||
this.ipcService = IpcService.getInstance();
|
||||
this.modals = ModalService.getInsance();
|
||||
}
|
||||
|
||||
public open(url: string, internal?: boolean): void{
|
||||
if(internal){
|
||||
this.modals.openModal(IframeModal, url);
|
||||
return;
|
||||
return this._iframeLink$.next(url);
|
||||
}
|
||||
this.ipcService.sendLazy("new-window", {args: url});
|
||||
}
|
||||
|
||||
public closeIframe(){
|
||||
this._iframeLink$.next(null);
|
||||
}
|
||||
|
||||
public get iframeLink$(): Observable<string>{
|
||||
return this._iframeLink$.asObservable();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user