feat: improve browser compatibility for TypeIt and object-fit (#293)
* object-fit polyfill * TypeIt 7.0.3 -> 6.5.1
This commit is contained in:
@@ -40,6 +40,7 @@ class Theme {
|
||||
this.resizeEventSet = new Set();
|
||||
this.switchThemeEventSet = new Set();
|
||||
this.clickMaskEventSet = new Set();
|
||||
if (objectFitImages) objectFitImages();
|
||||
}
|
||||
|
||||
initSVGIcon() {
|
||||
@@ -56,7 +57,7 @@ class Theme {
|
||||
if ($titleElements.length) $svg.removeChild($titleElements[0]);
|
||||
$icon.parentElement.replaceChild($svg, $icon);
|
||||
})
|
||||
.catch(console.error.bind(console));
|
||||
.catch(err => { console.error(err); });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -586,12 +587,7 @@ class Theme {
|
||||
}
|
||||
|
||||
initSmoothScroll() {
|
||||
if ((!this.util.isMobile() && this.config.headerMode.desktop === 'normal')
|
||||
|| (this.util.isMobile() && this.config.headerMode.mobile === 'normal')) {
|
||||
new SmoothScroll('[href^="#"]', {speed: 300, speedAsDuration: true});
|
||||
} else {
|
||||
new SmoothScroll('[href^="#"]', {speed: 300, speedAsDuration: true, header: '#header-desktop'});
|
||||
}
|
||||
if (SmoothScroll) new SmoothScroll('[href^="#"]', { speed: 300, speedAsDuration: true, header: '#header-desktop' });
|
||||
}
|
||||
|
||||
onScroll() {
|
||||
|
||||
Reference in New Issue
Block a user