I have a popup window in which I want to display any (own) page.
This already works very well, but I'm having problems with the size of the window.
My first attempt was to work with absolute sizes. But that doesn't work with the content. This is exclusively dynamic with HTML template and CSS.
Now I'm trying to design the popup window with HTML.
My concern is:
I call the popup with a fixed width or let it calculate to 90% of the browser window.
The height must be calculated automatically. Depending on the content.
Here is my code for the popup window:
procedure CallPopup( ATitel: String; ABreite, AHoehe: Integer;AFrameClass: TWebBasisFormClass; AParam: TJSArray;
APopupResultProc: TPopupResultProc); overload;
var
Popup: TWebPopupForm;
begin
Popup := TWebPopupForm.CreateNew( procedure( AForm: TObject)
begin
(AForm as TWebPopupForm).FFrame := AFrameClass.CreateNew( 'divFrame', procedure( AForm: TObject)
begin
TWebBasisForm( AForm).Init( AParam);
end);
end);
Popup.Caption := ATitel;
Popup.Popup := True;
Popup.Border := fbDialogSizeable;
if ABreite < 0 then begin
asm
ABreite = window.innerWidth;
end;
ABreite := round(ABreite * 0.9);
end;
// ??????????????
if AHoehe < 0 then begin
Popup.ElementPosition := epRelative; // ??????????????
end;
Popup.Width := ABreite;
Popup.Height := AHoehe; // ??????????????
window.location.hash := 'subform';
Popup.ShowModal( procedure( AValue: TModalResult)
begin
if AValue = mrOk then
APopupResultProc( Popup.PopupResult);
end
);
end;
The HTML-Code is not ready:
<div class="container-fluid">
<div class="row">
<div class="col-12"><div id="divFrame"></div></div>
<div class="col-10"></div>
<div class="col-1"><a id="aAbbrechen">Abbrechen</a></div>
<div class="col-1"><button id="btnUebernehmen">Übernehmen</button></div>
</div>
</div>
Can somebody help me