[refactor]: check for the ispc-html class is done using a regular expression to ensure that the class is only added once when the browser window is resized (#301)
This commit is contained in:
parent
cce508d17a
commit
9753215281
@ -15,8 +15,10 @@
|
|||||||
|
|
||||||
if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
|
if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
|
||||||
width = width < PC_W ? width : PC_W
|
width = width < PC_W ? width : PC_W
|
||||||
|
if (!docEl.className.includes('ispc-html')) {
|
||||||
docEl.className += ' ispc-html'
|
docEl.className += ' ispc-html'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var f = Math.min(width / 7.5, 50)
|
var f = Math.min(width / 7.5, 50)
|
||||||
docEl.style.fontSize = f + 'px'
|
docEl.style.fontSize = f + 'px'
|
||||||
|
Loading…
Reference in New Issue
Block a user