diff --git a/demo/fcldb/demorest.lpr b/demo/fcldb/demorest.lpr index c6d1a10..2f805ec 100644 --- a/demo/fcldb/demorest.lpr +++ b/demo/fcldb/demorest.lpr @@ -185,7 +185,7 @@ Var e : TJSElement; begin - e:=aEvent.target; + e:=TJSElement(aEvent.target); While Assigned(e) and Not SameText(e.nodeName,'tr') do e:=e.parentElement; if Not Assigned(E) then exit; diff --git a/demo/fpreport/frmmain.pp b/demo/fpreport/frmmain.pp index 6ec7709..d4e501d 100644 --- a/demo/fpreport/frmmain.pp +++ b/demo/fpreport/frmmain.pp @@ -118,7 +118,7 @@ Var begin Result:=true; - tid:=aEvent.CurrentTarget.id; + tid:=TJSElement(aEvent.CurrentTarget).id; ActivateTab(tid); If (tid='navpdf') then Activate(PPDFOptions) diff --git a/packages/rtl/web.pas b/packages/rtl/web.pas index 0acb36a..d2e3e8d 100644 --- a/packages/rtl/web.pas +++ b/packages/rtl/web.pas @@ -61,12 +61,15 @@ Type { TEventListenerEvent } - TEventListenerEvent = class external name 'EventListener_Event' (TJSObject) +(* +TEventListenerEvent = class external name 'EventListener_Event' (TJSObject) private FTarget: TJSEventTarget; external name 'target'; public Property target: TJSEventTarget Read FTarget; end; +*) + TEventListenerEvent = TJSEvent; TJSEventHandler = reference to function(Event: TEventListenerEvent): boolean; TJSRawEventHandler = reference to Procedure(Event: TJSEvent); @@ -426,10 +429,12 @@ Type FBubbles : Boolean; external name 'bubbles'; FCancelable : Boolean; external name 'cancelable'; FComposed : Boolean; external name 'composed'; - FCurrentTarget : TJSElement; external name 'currentTarget'; + FCurrentTarget : TJSEventTarget; external name 'currentTarget'; + FCurrentTargetElement : TJSElement; external name 'currentTarget'; FdefaultPrevented : Boolean; external name 'defaultPrevented'; FEventPhase : NativeInt; external name 'eventPhase'; - FTarget : TJSElement; external name 'target'; + FTarget : TJSEventTarget; external name 'target'; + FTargetElement : TJSElement; external name 'target'; FTimeStamp : NativeInt; external name 'timestamp'; FType : String; external name 'type'; FIsTrusted : Boolean; external name 'isTrusted'; @@ -449,10 +454,12 @@ Type Property bubbles : Boolean Read FBubbles; Property cancelable : Boolean Read FCancelable; Property composed : Boolean Read FComposed; - property currentTarget : TJSElement Read FCurrentTarget; + property currentTarget : TJSEventTarget Read FCurrentTarget; + property currentTargetElement : TJSElement Read FCurrentTargetElement; property defaultPrevented : Boolean Read FdefaultPrevented; property eventPhase : NativeInt Read FEventPhase; - property target : TJSElement Read FTarget; + property target : TJSEventTarget Read FTarget; + property targetElement : TJSElement Read FTargetElement; Property timestamp : NativeInt Read FTimeStamp; property _type : string read FType; property isTrusted : Boolean Read FIsTrusted;