]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixed image full view lightbox.
authorSem <sembrestels@riseup.net>
Wed, 1 Aug 2012 19:13:28 +0000 (21:13 +0200)
committerSem <sembrestels@riseup.net>
Wed, 1 Aug 2012 19:13:28 +0000 (21:13 +0200)
views/default/js/photos/tidypics.php

index 8690898501f7647176bcfc7018122a52234bb07c..1ff7b2c407f510ab81fa729fa7e8c653b01cba79 100644 (file)
@@ -12,8 +12,12 @@ elgg.tidypics.init = function() {
        if (elgg.ui.lightbox) {
                $('.elgg-lightbox, .elgg-lightbox-photo').colorbox({
                        href: function() {
-                               var guid = (new RegExp("photos/image/[0-9]+", 'i')).exec($(this).attr('href')).toString().substr("photos/image/".length);
-                               return elgg.config.wwwroot + "photos/thumbnail/" + guid + "/large";
+                               if ((new RegExp("photos/image/[0-9]+", 'i')).test($(this).attr('href'))) {
+                                       var guid = (new RegExp("photos/image/[0-9]+", 'i')).exec($(this).attr('href')).toString().substr("photos/image/".length);
+                                       return elgg.config.wwwroot + "photos/thumbnail/" + guid + "/large";
+                               } else {
+                                       return $(this).attr('href');
+                               }
                        },
                        title: function() {
                                return '<h3 style="display: inline">'+ $(this).find('img').attr('title') +'</h3> - <a href="'+ $(this).attr('href') +'">'+ elgg.echo('comments') +'</a>';