Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 682a450

Browse files
committed
refactor(aria): add $window before getComputedStyle
1 parent 1a0e757 commit 682a450

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/core/services/aria/aria.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
angular.module('material.core')
55
.service('$mdAria', AriaService);
66

7-
function AriaService($$rAF, $log) {
7+
function AriaService($$rAF, $log, $window) {
88

99
return {
1010
expect: expect,
@@ -50,11 +50,10 @@ function AriaService($$rAF, $log) {
5050

5151
function childHasAttribute(node, attrName) {
5252
var hasChildren = node.hasChildNodes(),
53-
childHasAttribute = false;
53+
hasAttr = false;
5454

5555
function isHidden(el) {
56-
var style = el.currentStyle ? el.currentStyle :
57-
getComputedStyle(el);
56+
var style = el.currentStyle ? el.currentStyle : $window.getComputedStyle(el);
5857
return (style.display === 'none');
5958
}
6059

@@ -64,12 +63,12 @@ function AriaService($$rAF, $log) {
6463
var child = children[i];
6564
if(child.nodeType === 1 && child.hasAttribute(attrName)) {
6665
if(!isHidden(child)){
67-
childHasAttribute = true;
66+
hasAttr = true;
6867
}
6968
}
7069
}
7170
}
72-
return childHasAttribute;
71+
return hasAttr;
7372
}
7473
}
7574
})();

0 commit comments

Comments
 (0)