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

Commit d35c3bb

Browse files
fix(tests): remove invalid use of css private names
1 parent 54573b3 commit d35c3bb

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/components/menuBar/menu-bar.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ describe('material.components.menuBar', function() {
7979

8080
function getOpenSubMenu() {
8181
debugger;
82-
var containers = document.body.querySelectorAll('._md-open-menu-container._md-active');
82+
var containers = document.body.querySelectorAll('.md-open-menu-container.md-active');
8383
var lastContainer = containers.item(containers.length - 1);
8484

8585
return angular.element(lastContainer.querySelector('md-menu-content'));

src/core/util/util.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,19 @@ function UtilFactory($document, $timeout, $compile, $rootScope, $$mdAnimate, $in
642642
return current;
643643
},
644644

645+
/**
646+
* Parses an attribute value, mostly a string.
647+
* By default checks for negated values and returns `false´ if present.
648+
* Negated values are: (native falsy) and negative strings like:
649+
* `false` or `0`.
650+
* @param value Attribute value which should be parsed.
651+
* @param negatedCheck When set to false, won't check for negated values.
652+
* @returns {boolean}
653+
*/
654+
parseAttributeBoolean: function(value, negatedCheck) {
655+
return value === '' || !!value && (negatedCheck === false || value !== 'false' && value !== '0');
656+
},
657+
645658
hasComputedStyle: hasComputedStyle
646659
};
647660

0 commit comments

Comments
 (0)