]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frost-mobile/js/main.js
Merge pull request #556 from fermionic/20121224-smarty3-template-collision
[friendica.git] / view / theme / frost-mobile / js / main.js
index b751b8398f6521f51f74e5b8fa6d6be962e33808..a56c313125d77dfc4f0c14b0c692f50e6222bd7e 100644 (file)
@@ -38,6 +38,8 @@
 
                msie = $j.browser.msie ;
                
+               collapseHeight();
+
                /* setup tooltips *//*
                $j("a,.tt").each(function(){
                        var e = $j(this);
                        });
 
 
-                       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();
-                       }
+                       collapseHeight();
 
                        // reset vars for inserting individual items
 
                });
        }
 
-       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');
-                               }
-                       }                                       
+       function collapseHeight(elems) {
+               var elemName = '.wall-item-body:not(.divmore)';
+               if(typeof elems != 'undefined') {
+                       elemName = elems + ' ' + elemName;
+               }
+               $j(elemName).each(function() {
+                       if($j(this).height() > 350) {
+                               $j('html').height($j('html').height());
+                               $j(this).divgrow({ initialHeight: 300, showBrackets: false, speed: 0 });
+                               $j(this).addClass('divmore');
+                               $j('html').height('auto');
+                       }
                });
        }
 
                else {
                        $j("#collapsed-comments-" + id).show();
                        $j("#hide-comments-" + id).html(window.showFewer);
+                       collapseHeight("#collapsed-comments-" + id);
                }
        }