]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix imageviewer not showing up when using the actions menu
authorRobin Appelman <icewind1991@gmail.com>
Sat, 4 Jun 2011 20:21:16 +0000 (22:21 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Sat, 4 Jun 2011 20:21:16 +0000 (22:21 +0200)
apps/files_imageviewer/js/lightbox.js

index dd091aa0d7710576736390acfcb649156f2bdca7..e29bc510ee361ac51c7d8af7e0211a00682e566b 100644 (file)
@@ -1,3 +1,4 @@
+var lightBoxShown=false;
 $(document).ready(function() {
        images={};//image cache
        FileActions.register('image','View',function(filename){
@@ -38,9 +39,12 @@ function showLightbox(container,img){
        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