From: Daniel Date: Wed, 18 Jul 2018 21:02:59 +0000 (+0000) Subject: Fixed docs when Vimeo fails to load X-Git-Tag: 0.7.2~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69745cfda542dd716404c5b0aeb7fd0b2b8087e1;p=thirdparty%2Fbulma.git 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). --- diff --git a/docs/_javascript/index.js b/docs/_javascript/index.js index 08753358a..a7678c1e3 100644 --- a/docs/_javascript/index.js +++ b/docs/_javascript/index.js @@ -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!';