[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 GitHub
parent cce508d17a
commit 9753215281
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,7 +15,9 @@
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
docEl.className += ' ispc-html' if (!docEl.className.includes('ispc-html')) {
docEl.className += ' ispc-html'
}
} }
var f = Math.min(width / 7.5, 50) var f = Math.min(width / 7.5, 50)