mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-20 15:29:17 +02:00
* Make creation of data-tags optional
This commit is contained in:
parent
1308f6be51
commit
fe5ab42f2c
@ -447,6 +447,8 @@ Type
|
|||||||
Property HaveReferences : Boolean Read GetHaveReferences;
|
Property HaveReferences : Boolean Read GetHaveReferences;
|
||||||
// Property attrs
|
// Property attrs
|
||||||
Property StoredAttrs : TJSObject Read FAttrs;
|
Property StoredAttrs : TJSObject Read FAttrs;
|
||||||
|
Public
|
||||||
|
Class var CreateDataTags : Boolean;
|
||||||
Public
|
Public
|
||||||
Constructor Create(aOwner : TComponent); override;
|
Constructor Create(aOwner : TComponent); override;
|
||||||
Destructor Destroy; override;
|
Destructor Destroy; override;
|
||||||
@ -475,7 +477,7 @@ Type
|
|||||||
Procedure Refresh;
|
Procedure Refresh;
|
||||||
// Unrender
|
// Unrender
|
||||||
Procedure Unrender; overload;
|
Procedure Unrender; overload;
|
||||||
// Focus
|
// Focus widget. Will render if it was not yet rendered.
|
||||||
Procedure Focus;
|
Procedure Focus;
|
||||||
// These work on the classes property, and on the current element if rendered. Returns the new value of classes.
|
// These work on the classes property, and on the current element if rendered. Returns the new value of classes.
|
||||||
Function AddRemoveClasses(const aAddClasses, aRemoveClasses : String; Normalize : Boolean = false) : String;
|
Function AddRemoveClasses(const aAddClasses, aRemoveClasses : String; Normalize : Boolean = false) : String;
|
||||||
@ -2819,13 +2821,13 @@ Var
|
|||||||
Procedure MaybeSet(El : TJSHTMLElement; AName : String);
|
Procedure MaybeSet(El : TJSHTMLElement; AName : String);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if Assigned(el) then
|
if Assigned(el) and CreateDataTags then
|
||||||
el.Dataset[aName]:=AID;
|
el.Dataset[aName]:=AID;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
AID:=ElementID;
|
AID:=ElementID;
|
||||||
if assigned(Element) then
|
if assigned(Element) and Not CreateDataTags then
|
||||||
Element.dataset[SElementClass]:=ClassName;
|
Element.dataset[SElementClass]:=ClassName;
|
||||||
MaybeSet(Element,SElementData);
|
MaybeSet(Element,SElementData);
|
||||||
MaybeSet(TopElement,STopElementData);
|
MaybeSet(TopElement,STopElementData);
|
||||||
|
Loading…
Reference in New Issue
Block a user