MediaWiki:Common.js/Clases/PlantillaPlegable-min.js

// Versión comprimida. Véase MediaWiki:Common.js/Clases/PlantillaPlegable.js (function{var $=jQuery,$UT=UtilityTools;var f='plegable-ctrl',K_MOSTRAR='mostrar',K_OCULTAR='ocultar';PlantillaPlegable=function(a,b){this.oElem=a;this.oCtrl=null;this.bPlegada=false;this.bInicialPlegada=(b||false);this.bAjustado=false;this.init};PlantillaPlegable.prototype={version:'1.1',init:function{if(this.oElem.tagName.toLowerCase!='table'||!this.oElem.rows.length)return;var b=this.oElem.rows[0];for(var i=0,ss=b.getElementsByTagName('span');i<ss.length;i++){if($UT.hasClass(ss[i],f)){ss[i].tabIndex='0';this.oCtrl=ss[i];break}}if(!this.oCtrl){var c=b.cells[b.cells.length-1];this.oCtrl=$UT.create('span',{'class':f,tabindex:'0'});c.hasChildNodes?c.insertBefore(this.oCtrl,c.firstChild):c.appendChild(this.oCtrl)}$UT.addHandler(this.oCtrl,'click',function(a){return function{a.cambiarEstado(!a.bPlegada)}}(this));$UT.addHandler(this.oCtrl,'keyup',function(a){return function(e){$E.getCharCode(e)==13&&a.cambiarEstado(!a.bPlegada)}}(this));this.cambiarEstado(this.bInicialPlegada)},cambiarEstado:function(a){this.oCtrl.innerHTML=;$UT.makeChildren([(a?K_MOSTRAR:K_OCULTAR)],this.oCtrl);var b=$(this.oElem);var c=b.width;for(var i=1,rs=this.oElem.rows;i<rs.length&&a!=this.bPlegada;i++){var d=$(rs[i]);if(a){d.hide}else{d.show}}this.bPlegada=a;var e=b.width;if(a&&e!==c&&this.oElem.style.width===){this.bAjustado=true;b.width(c)}if(this.bAjustado&&!a)this.oElem.style.width=''}}}); //