1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-22 12:50:36 +01:00

domRectTest: hide detail data

This commit is contained in:
kkapsner 2020-07-29 14:14:13 +02:00
parent 3ab6366994
commit 3eea8fe7c4
3 changed files with 17 additions and 1 deletions

View File

@ -86,4 +86,14 @@
.testRect {
outline: 2px dotted lightblue;
}
.content-hidable.content-hidden .content, .content-hidable .anti-content {
display: none;
}
.content-hidable .content, .content-hidable.content-hidden .anti-content {
display: initial;
}
.content-hidable .toggle {
cursor: pointer;
}

View File

@ -145,5 +145,11 @@
return range.getBoundingClientRect();
}, useIframe);
});
document.querySelectorAll(".content-hidable").forEach(function(parentNode){
parentNode.querySelector(".toggle").addEventListener("click", function(){
parentNode.classList.toggle("content-hidden");
});
});
});
}());

View File

@ -22,7 +22,7 @@
<div class="test">
<h3 class="title"></h3>
Hash: <span class="hash"></span><br>
Data: <span class="data"></span><br>
<span class="content-hidable content-hidden">Data: <span class="toggle"><span class="anti-content">&plus;</span><span class="content">&minus;</span></span><span class="data content"></span></span><br>
<button class="refresh">refresh</button>
<button class="performance">measure performance</button>
</div>