mirror of
https://github.com/jgthms/bulma
synced 2026-03-15 10:14:29 -07:00
Fixed docs when Vimeo fails to load
All javascript breaks if Vimeo fails to load or is blocked. Checking for `Vimeo` before accessing it should fix it. This can easily be reproduced using [uMatrix](https://github.com/gorhill/uMatrix).
This commit is contained in:
@@ -4,12 +4,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
const introVideo = document.getElementById('introVideo');
|
||||
const introIframe = document.getElementById('introIframe');
|
||||
const introPlayer = new Vimeo.Player(introIframe);
|
||||
const npmClipboard = new Clipboard('#npmCopy');
|
||||
|
||||
introPlayer.ready().then(function() {
|
||||
introVideo.classList.add('has-loaded');
|
||||
});
|
||||
if (Vimeo) {
|
||||
const introPlayer = new Vimeo.Player(introIframe);
|
||||
introPlayer.ready().then(function() {
|
||||
introVideo.classList.add('has-loaded');
|
||||
});
|
||||
}
|
||||
|
||||
npmClipboard.on('success', function(e) {
|
||||
e.trigger.innerText = 'copied!';
|
||||
|
||||
Reference in New Issue
Block a user