+var lightBoxShown=false;
$(document).ready(function() {
images={};//image cache
FileActions.register('image','View',function(filename){
container.append(img);
container.css('top',Math.round( ($( window ).height() - img.height)/2));
container.css('left',Math.round( ($( window ).width() - img.width)/2));
+ lightBoxShown=true;
}
function hideLightbox(){
- $('#lightbox_overlay').remove();
- $('#lightbox').remove();
+ if(lightBoxShown){
+ $('#lightbox_overlay').remove();
+ $('#lightbox').remove();
+ }
}
\ No newline at end of file