Properly remove event from landing page DOM object

This commit is contained in:
Saivann 2015-06-26 15:26:05 -04:00
parent 7013b784f3
commit 17886b6564
2 changed files with 6 additions and 8 deletions

View file

@ -6,7 +6,7 @@ layout: base
id: index
---
<script>
function loadMainVideo(e) {
function loadMainVideo() {
var p = document.getElementById('mainvideo'),
t = p.getElementsByTagName('DIV')[0],
nd = document.createElement('IFRAME');
@ -15,12 +15,11 @@ nd.setAttribute('frameborder', 0);
nd.setAttribute('allowfullscreen', true);
t.innerHTML = '';
t.appendChild(nd);
removeEvent(p, loadMainVideo);
cancelEvent(e);
p.onclick = '';
}
</script>
<p class="mainsummary">{% translate listintro %}</p>
<div class="mainvideo" id="mainvideo" onclick="loadMainVideo(event);"><div>
<div class="mainvideo" id="mainvideo" onclick="loadMainVideo();"><div>
<img src="/img/video/video_wuc.jpg" alt="Youtube video">
<div class="mainvideoicon"></div>
<div class="mainvideoiconhover"></div>

View file

@ -8,7 +8,7 @@ id: index
title: Bitcoin
---
<script>
function loadMainVideo(e) {
function loadMainVideo() {
var p = document.getElementById('mainvideo'),
t = p.getElementsByTagName('DIV')[0],
nd = document.createElement('IFRAME');
@ -17,12 +17,11 @@ nd.setAttribute('frameborder', 0);
nd.setAttribute('allowfullscreen', true);
t.innerHTML = '';
t.appendChild(nd);
removeEvent(p, loadMainVideo);
cancelEvent(e);
p.onclick = '';
}
</script>
<p class="mainsummary">{% translate listintro %}</p>
<div class="mainvideo" id="mainvideo" onclick="loadMainVideo(event);"><div>
<div class="mainvideo" id="mainvideo" onclick="loadMainVideo();"><div>
<img src="/img/video/video_wuc.jpg" alt="Youtube video">
<div class="mainvideoicon"></div>
<div class="mainvideoiconhover"></div>