fix(browser_adapter): element.matches only available with prefix (IE11)

This commit is contained in:
Marc Laval 2015-05-21 11:48:51 +02:00
parent 92c2c33a84
commit a393f84fa4
1 changed files with 2 additions and 1 deletions

View File

@ -279,7 +279,8 @@ setTitle(newTitle: string) {
document.title = newTitle || ''; document.title = newTitle || '';
} }
elementMatches(n, selector: string): boolean { elementMatches(n, selector: string): boolean {
return n instanceof HTMLElement && n.matches(selector); return n instanceof HTMLElement && n.matches ? n.matches(selector) :
n.msMatchesSelector(selector);
} }
isTemplateElement(el: any): boolean { isTemplateElement(el: any): boolean {
return el instanceof HTMLElement && el.nodeName == "TEMPLATE"; return el instanceof HTMLElement && el.nodeName == "TEMPLATE";