mirror of
https://github.com/jgthms/bulma.git
synced 2024-11-14 11:14:24 +00: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:
parent
ae662fefc0
commit
69745cfda5
@ -4,12 +4,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
|
|
||||||
const introVideo = document.getElementById('introVideo');
|
const introVideo = document.getElementById('introVideo');
|
||||||
const introIframe = document.getElementById('introIframe');
|
const introIframe = document.getElementById('introIframe');
|
||||||
const introPlayer = new Vimeo.Player(introIframe);
|
|
||||||
const npmClipboard = new Clipboard('#npmCopy');
|
const npmClipboard = new Clipboard('#npmCopy');
|
||||||
|
|
||||||
introPlayer.ready().then(function() {
|
if (Vimeo) {
|
||||||
introVideo.classList.add('has-loaded');
|
const introPlayer = new Vimeo.Player(introIframe);
|
||||||
});
|
introPlayer.ready().then(function() {
|
||||||
|
introVideo.classList.add('has-loaded');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
npmClipboard.on('success', function(e) {
|
npmClipboard.on('success', function(e) {
|
||||||
e.trigger.innerText = 'copied!';
|
e.trigger.innerText = 'copied!';
|
||||||
|
Loading…
Reference in New Issue
Block a user