chore(e2e): add domCount() perf tool

This commit is contained in:
Manu Mtz.-Almeida
2017-05-03 14:51:07 +02:00
parent 59dd853f54
commit 27a70fbdd8

View File

@ -26,6 +26,17 @@
document.dir = 'ltr'; document.dir = 'ltr';
} }
window.domCount = function domCount(ele) {
if(!ele) {
return 0;
}
var count = 1;
for(var i = 0; i < ele.children.length; i++) {
count += domCount(ele.children[i]);
}
return count;
}
if (location.href.indexOf('theme=dark') > -1) { if (location.href.indexOf('theme=dark') > -1) {
var link = document.getElementById('ionicLink'); var link = document.getElementById('ionicLink');
link.setAttribute('href', link.getAttribute('href').replace('.css', '.dark.css')); link.setAttribute('href', link.getAttribute('href').replace('.css', '.dark.css'));