]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frost-mobile/js/main.js
Merge pull request #473 from pixelroot/master
[friendica.git] / view / theme / frost-mobile / js / main.js
index 7498c3b91f536a8dbf988e7557aecd721d750c98..aaa69e7078c6c455e9d5e28dfc8ffa2a56cfff82 100644 (file)
                        }
                        /* autocomplete @nicknames */
                        $j(".comment-edit-form  textarea").contact_autocomplete(baseurl+"/acl");
+
+                       var bimgs = $j(".wall-item-body > img").not(function() { return this.complete; });
+                       var bimgcount = bimgs.length;
+
+                       if (bimgcount) {
+                               bimgs.load(function() {
+                                       bimgcount--;
+                                       if (! bimgcount) {
+                                               collapseHeight();
+
+                                       }
+                               });
+                       } else {
+                               collapseHeight();
+                       }
+
+               });
+       }
+
+       function collapseHeight() {
+               $j(".wall-item-body").each(function() {
+                               if($j(this).height() > 310) {
+                               if(! $j(this).hasClass('divmore')) {
+                                       $j(this).divgrow({ initialHeight: 300, showBrackets: false, speed: 0 });
+                                       $j(this).addClass('divmore');
+                               }
+                       }                                       
                });
        }
 
@@ -657,7 +684,7 @@ Array.prototype.remove = function(item) {
 function previewTheme(elm) {
        theme = $j(elm).val();
        $j.getJSON('pretheme?f=&theme=' + theme,function(data) {
-                       $j('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div><a href="' + data.img + '"><img src="' + data.img + '" width="320" height="240" alt="' + theme + '" /></a>');
+                       $j('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div>');
        });
 
 }