mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-09-11 13:09:10 +02:00
* "OnElementBound event
This commit is contained in:
parent
85c8e7d0f6
commit
f64a034b69
@ -104,6 +104,7 @@ Type
|
|||||||
|
|
||||||
THTMLNotifyEvent = Procedure (Sender : TObject; Event : TJSEvent) of object;
|
THTMLNotifyEvent = Procedure (Sender : TObject; Event : TJSEvent) of object;
|
||||||
|
|
||||||
|
|
||||||
TEventDispatch = Record
|
TEventDispatch = Record
|
||||||
MsgStr : String;
|
MsgStr : String;
|
||||||
HTMLEvent : TJSEvent;
|
HTMLEvent : TJSEvent;
|
||||||
@ -305,6 +306,7 @@ Type
|
|||||||
FAfterUnRenderHTML: TNotifyEvent;
|
FAfterUnRenderHTML: TNotifyEvent;
|
||||||
FBeforeRenderHTML: TNotifyEvent;
|
FBeforeRenderHTML: TNotifyEvent;
|
||||||
FBeforeUnRenderHTML: TNotifyEvent;
|
FBeforeUnRenderHTML: TNotifyEvent;
|
||||||
|
FOnElementBound: TNotifyEvent;
|
||||||
FParent : TCustomWebWidget;
|
FParent : TCustomWebWidget;
|
||||||
FMyHook : TJSRawEventHandler;
|
FMyHook : TJSRawEventHandler;
|
||||||
// Set by setting ParentID or Parent
|
// Set by setting ParentID or Parent
|
||||||
@ -509,6 +511,8 @@ Type
|
|||||||
Property Visible : Boolean Read GetVisible Write SetVisible;
|
Property Visible : Boolean Read GetVisible Write SetVisible;
|
||||||
// Is the ElementID Set
|
// Is the ElementID Set
|
||||||
Property FixedElementID : Boolean Read GetFixedElementID;
|
Property FixedElementID : Boolean Read GetFixedElementID;
|
||||||
|
// When the element is bound
|
||||||
|
Property OnElementBound : TNotifyEvent Read FOnElementBound Write FOnElementBound;
|
||||||
// This protected section can be published in descendents
|
// This protected section can be published in descendents
|
||||||
Protected
|
Protected
|
||||||
// Parent or Element ID: Will be used when determining the HTML element when rendering.
|
// Parent or Element ID: Will be used when determining the HTML element when rendering.
|
||||||
@ -2216,6 +2220,8 @@ begin
|
|||||||
ApplyData;
|
ApplyData;
|
||||||
RefreshReferences; // After data, so data can be used in selectors
|
RefreshReferences; // After data, so data can be used in selectors
|
||||||
end;
|
end;
|
||||||
|
if Assigned(FOnElementBound) then
|
||||||
|
FOnElementBound(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomWebWidget.InvalidateParentElement;
|
procedure TCustomWebWidget.InvalidateParentElement;
|
||||||
@ -2909,10 +2915,12 @@ end;
|
|||||||
procedure TCustomWebWidget.RefreshReferences;
|
procedure TCustomWebWidget.RefreshReferences;
|
||||||
begin
|
begin
|
||||||
if Assigned(FReferences) then
|
if Assigned(FReferences) then
|
||||||
|
begin
|
||||||
if Assigned(Element) then
|
if Assigned(Element) then
|
||||||
References.RefreshFromDom(GetReferenceElement)
|
References.RefreshFromDom(GetReferenceElement)
|
||||||
else
|
else
|
||||||
References.FRefs:=Nil;
|
References.FRefs:=Nil
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TCustomWebWidget.GenerateID: String;
|
class function TCustomWebWidget.GenerateID: String;
|
||||||
|
Loading…
Reference in New Issue
Block a user