[Pas2js] move property style to TJSElement :: feature request

warleyalex warleyalex at yahoo.com.br
Fri Nov 2 14:26:31 CET 2018


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/


More information about the Pas2js mailing list