[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:
yelang 2024-06-21 20:59:58 +08:00 committed by sudoooooo
parent 2ab96606aa
commit a679ad20bb

View File

@ -15,7 +15,9 @@
if (!/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
width = width < PC_W ? width : PC_W
docEl.className += ' ispc-html'
if (!docEl.className.includes('ispc-html')) {
docEl.className += ' ispc-html'
}
}
var f = Math.min(width / 7.5, 50)