Rev Author Line No. Line
4988 kaklik 1 // This div is generated by header.tmpl; remove it to display only on mouseover
2 var popup = document.getElementById('rev-popup');
3 document.getElementById('wrapper').removeChild(popup);
4 popup.style.display = 'block';
5  
6 // Add event listeners to display/hide the popup when hovering the revnum header
7 var revnum = document.getElementById('revnum');
8 addEvent(revnum, 'mouseover', function() {this.parentNode.appendChild(popup)});
9 addEvent(revnum, 'mouseout', function() {this.parentNode.removeChild(popup)});
10  
11 function addEvent(obj, type, func) {
12 if (obj.addEventListener) {
13 obj.addEventListener(type, func, false);
14 return true;
15 } else if (obj.attachEvent) {
16 return obj.attachEvent('on'+type, func);
17 } else {
18 return false;
19 }
20 }