MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 118: Line 118:
if (document.getElementById('drawer-button-'+i)) {
if (document.getElementById('drawer-button-'+i)) {
document.getElementById('drawer-button-'+i).addEventListener('click', function(){ drawerExpand(i); } );
document.getElementById('drawer-button-'+i).addEventListener('click', function(){ drawerExpand(i); } );
console.log("aggiunto eventListener per drawer-button-"+i);
}
}
}
}


function drawerExpand(x) {
function drawerExpand(x) {
console.log("variabile x: "+x);
   var y = "drawer-"+x; //outputs something like "drawer-1"
   var y = "drawer-"+x; //outputs something like "drawer-1"
   console.log("variabile y: "+y);
   console.log("variabile y: "+y);