[Pas2js] move property style to TJSElement :: feature request
Ulrich, Christian
christian.ulrich at tcsag.de
Fri Nov 2 14:30:56 CET 2018
Why not declare Button.Handle as JSHTMLElement ?
-----Ursprüngliche Nachricht-----
Von: Pas2js [mailto:pas2js-bounces at lists.freepascal.org] Im Auftrag von warleyalex via Pas2js
Gesendet: Freitag, 2. November 2018 14:27
An: pas2js at lists.freepascal.org
Cc: warleyalex
Betreff: [Pas2js] move property style to TJSElement :: feature request
if I delete the public field "style" from the definition TJSHTMLElement and
adds
a public property "style" at the TJSElement class, it breaks the
definition...,
whatsoever, the TJSHTMLElement will access the property style any time,
and we can "directly" do this, for instance:
button1.Handle.style.setProperty('width', 'calc(100% - 20px)');
instead of the ugly:
TJSHTMLElement(button1.Handle).style.setProperty('width', 'calc(100% -
20px)');
----- CODE -----
TJSHTMLElement = class external name 'HTMLELement' (TJSElement)
Public
//style : TJSCSSStyleDeclaration;
end;
TJSElement = class external name 'Element' (TJSNode)
Private
Fstyle: TJSCSSStyleDeclaration; external name 'style';
Public
property style: TJSCSSStyleDeclaration read fstyle;
end;
----------------
--
Sent from: http://pas2js.38893.n8.nabble.com/
_______________________________________________
Pas2js maillist - Pas2js at lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js
More information about the Pas2js
mailing list