mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-18 13:39:23 +02:00
* Fix demo to work again with latest webwidgets
This commit is contained in:
parent
78cff9a0ec
commit
efea6321bd
demo/webwidget/designdemo
@ -28,12 +28,11 @@
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="0"/>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="1">
|
||||
<Item1>
|
||||
<RequiredPackages>
|
||||
<Item>
|
||||
<PackageName Value="lazwebwidgets"/>
|
||||
</Item1>
|
||||
</Item>
|
||||
</RequiredPackages>
|
||||
<Units>
|
||||
<Unit>
|
||||
@ -88,16 +87,16 @@
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Exceptions>
|
||||
<Item>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
</Item>
|
||||
<Item>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
</Item>
|
||||
<Item>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Item>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
||||
|
@ -1,7 +1,7 @@
|
||||
program designdemo;
|
||||
|
||||
{$mode objfpc}
|
||||
{$DEFINE USEIDE}
|
||||
{ $DEFINE USEIDE}
|
||||
|
||||
uses
|
||||
browserapp, JS, Classes, SysUtils, Web, designer, webideclient;
|
||||
|
@ -70,7 +70,7 @@ Type
|
||||
|
||||
{ TJumboWidget }
|
||||
|
||||
TJumboWidget = class(TCustomTemplateWidget)
|
||||
TJumboWidget = class(TSimpleTemplateWidget)
|
||||
Public
|
||||
Constructor Create(aOwner: TComponent); override;
|
||||
end;
|
||||
@ -91,7 +91,7 @@ type
|
||||
constructor TJumboWidget.Create(aOwner: TComponent);
|
||||
begin
|
||||
inherited Create(aOwner);
|
||||
Template.Text:='<div class="jumbotron">'+sLineBreak+
|
||||
Template:='<div class="jumbotron">'+sLineBreak+
|
||||
'<h1 class="display-4">Hello, world!</h1>'+sLineBreak+
|
||||
'<p class="lead">This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>'+sLineBreak+
|
||||
'<hr class="my-4">'+sLineBreak+
|
||||
@ -145,6 +145,7 @@ begin
|
||||
S.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDesignDemo.DoActive(Event: TEventListenerEvent): boolean;
|
||||
|
||||
Const
|
||||
@ -164,7 +165,10 @@ begin
|
||||
JQuery('.designerToolbar').remove();
|
||||
aNewActive:=TJSHTMLElement(event.target);
|
||||
aParent:=FPage.FindWidgetByID(String(aNewActive.dataset[STopElementData]));
|
||||
if (FAddWidget<>Nil) and (aParent<>Nil) then
|
||||
if aParent=Nil then
|
||||
aParent:=FPage;
|
||||
|
||||
if (FAddWidget<>Nil) then
|
||||
begin
|
||||
aNewWidget:=FAddWidget;
|
||||
FAddWidget:=Nil;
|
||||
|
Loading…
Reference in New Issue
Block a user