mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Define DomElement.getComputedStyle()
This commit is contained in:
parent
fa29686202
commit
ab524b7642
1 changed files with 12 additions and 0 deletions
|
@ -32,6 +32,18 @@ var DomElement = new function() {
|
|||
}
|
||||
|
||||
return {
|
||||
getWindow: function(doc) {
|
||||
return doc.defaultView || doc.parentWindow;
|
||||
},
|
||||
|
||||
getComputedStyle: function(el, name) {
|
||||
if (el.currentStyle)
|
||||
return el.currentStyle[Base.camelize(name)];
|
||||
var style = DomElement.getWindow(el.ownerDocument).getComputedStyle(
|
||||
el, null);
|
||||
return style ? style.getPropertyValue(Base.hyphenate(name)) : null;
|
||||
},
|
||||
|
||||
getOffset: function(el, positioned, scroll) {
|
||||
var point = cumulate(el, 'offset', 'offsetParent', positioned);
|
||||
return scroll
|
||||
|
|
Loading…
Reference in a new issue