Retrospettiva 2026
LightWindow è morto da un pezzo – era una libreria modale dell’era Prototype.js, scomparsa intorno al 2010. Se oggi ti servono le modali, l’elemento HTML
LightWindow è morto da un pezzo – era una libreria modale dell’era Prototype.js, scomparsa intorno al 2010. Se oggi ti servono le modali, l’elemento HTML
<dialog> fa tutto nativamente.
Ecco, questo è il risultato di 2 giorni di testate contro il muro con lightwindow:
Index: public/javascripts/lightwindow.js, line 444
_removeLink : function(removed) {
// remove it from the links array
//
this.links = this.links.reject(function(link) {
if (link == removed.href)
return true;
});
// remove it from the gallery links array
//
if (gallery = this._getGalleryInfo(removed.rel)) {
klass = gallery[0];
name = gallery[1];
if (this.galleries[klass] && this.galleries[klass][name]) {
this.galleries[klass][name] =
this.galleries[klass][name].reject(function(link) {
if (link == removed.href)
return true;
});
}
}
},
Chiama questa funzione dal tuo template .rjs, qualcosa tipo:
page << "myLightWindow._removeLink($('element').down('a.lightwindow'));"
Più dettagli a seguire, quando questo lavoro sarà completo ;).