Avoid duplicate code and non-reusable functions with hardcoded variables

This commit is contained in:
Saivann 2015-06-26 17:13:00 -04:00
parent 17886b6564
commit 3d9c178df3
3 changed files with 15 additions and 28 deletions

View file

@ -115,6 +115,19 @@ for (var i = 0, n = domPrefixes.length; i < n; i++) {
return false;
}
function loadYoutubeVideo(e) {
// Load Youtube video on target node on click.
var t = getEventTarget(e),
nd = document.createElement('IFRAME');
while (t.getAttribute('data-youtubeurl') === null || t.getAttribute('data-youtubeurl') === '') t = t.parentNode;
nd.src = t.getAttribute('data-youtubeurl');
nd.setAttribute('frameborder', 0);
nd.setAttribute('allowfullscreen', true);
t.innerHTML = '';
t.appendChild(nd);
t.onclick = '';
}
function boxShow(e) {
// Display the box content when the user click a box on the "Secure your wallet" page.
var p = t = getEventTarget(e);