1
0
mirror of synced 2025-12-10 00:17:58 +08:00

chore(console): small changes

This commit is contained in:
redhoodsu
2019-11-01 19:59:33 +08:00
parent bf3d4c8ce3
commit 5c182696b1
3 changed files with 17 additions and 7 deletions

View File

@@ -577,10 +577,12 @@ export default class Logger extends Emitter {
let top = scrollTop
let bottom = scrollTop + offsetHeight
const tolerance = 1000
if (!force) {
if (
this._topSpaceHeight < top &&
this._topSpaceHeight + this._el.offsetHeight > bottom
this._topSpaceHeight < top - tolerance / 2 &&
this._topSpaceHeight + this._el.offsetHeight > bottom + tolerance / 2
) {
this._checkScrollBottom(false)
return
@@ -588,7 +590,6 @@ export default class Logger extends Emitter {
}
const displayLogs = this._displayLogs
const tolerance = 1000
top -= tolerance
bottom += tolerance

View File

@@ -2,6 +2,7 @@
.entry-btn {
width: 40px;
height: 40px;
display: flex;
background: #000;
opacity: 0.3;
border-radius: 10px;
@@ -10,8 +11,8 @@
transition: opacity 0.3s;
color: #fff;
font-size: 25px;
text-align: center;
line-height: 40px;
align-items: center;
justify-content: center;
&.active,
&:active {
opacity: 0.8;

View File

@@ -43,7 +43,10 @@
<a href="#" id="log">Log</a>
</li>
<li>
<a href="#" id="heavy-log">Heavy Log</a>
<a href="#" id="log-10000">Log 10000</a>
</li>
<li>
<a href="#" id="log-1000">Log 1000</a>
</li>
</ul>
</nav>
@@ -165,11 +168,16 @@
for (var i = 0; i < 10000; i++) arr.push(i);
console.log(arr);
});
addClickEvent('heavy-log', () => {
addClickEvent('log-10000', () => {
for (let i = 0; i < 10000; i++) {
console.log(location, i);
}
});
addClickEvent('log-1000', () => {
for (let i = 0; i < 1000; i++) {
console.log(location, i);
}
});
</script>
<script>
eruda.init();