elemental2.dom.HTMLDocument missing defaultView and elemental2.dom.Window missing getComputedStyle
See original GitHub issueFor example, I wanted to do this (JSNI JavaScript) in Elemental 2:
var zindex = document.defaultView.getComputedStyle(elems[i],null).getPropertyValue("z-index");
But I could not find defaultView on Document or HTMLDocument, and could not find getComputedStyle except on ViewCSS (it seems it should be on Window). What is ViewCSS and how do I achieve what I want here in Elemental 2? It seems it is not currently possible, and that my JSNI must stay for now…
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Window.getComputedStyle() - Web APIs | MDN
The Window.getComputedStyle() method returns an object containing the values of all CSS properties of an element, after applying active ...
Read more >How to use getComputedStyle with DOMParser produced ...
The resulting document object does not have a defaultView nor a window properties, so is there a way to call getComputedStyle() ? To...
Read more >dom Window.getComputedStyle() - CodeProject Reference
The Window.getComputedStyle() method gives the values of all the CSS properties of an element after applying the active stylesheets and resolving any basic ......
Read more >JavaScript Window getComputedStyle() Method - W3Schools
The getComputedStyle() method gets the computed CSS properties and values of an HTML element. The getComputedStyle() method returns a CSSStyleDeclaration object ...
Read more >Issues - elemental2 - Google - Geeks
elemental2.dom.HTMLDocument missing defaultView and elemental2.dom.Window missing getComputedStyle. #61 opened 3 years ago.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
From https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle, it looks like you don’t need to say
document.defaultView
but justwindow
(and actually both of those are wrong in JSNI, it should be$doc.defaultView
and$wnd
respectively).To achieve the same thing in jsinterop with Elemental2, try this:
Thanks!