X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Ffrost-mobile%2Fjs%2Fmain.js;h=aaa69e7078c6c455e9d5e28dfc8ffa2a56cfff82;hb=9c7d5d42e1dc3370a4d371472175e17bc505e5ca;hp=bffa7977ab0211cb12d22c10e76a2e626ac12b8d;hpb=04c31d194f07e3b7a39ab7c8d5690da840c11fb7;p=friendica.git diff --git a/view/theme/frost-mobile/js/main.js b/view/theme/frost-mobile/js/main.js index bffa7977ab..aaa69e7078 100644 --- a/view/theme/frost-mobile/js/main.js +++ b/view/theme/frost-mobile/js/main.js @@ -297,7 +297,7 @@ // add a new thread - $j('.tread-wrapper',data).each(function() { + $j('.toplevel_item',data).each(function() { var ident = $j(this).attr('id'); if($j('#' + ident).length == 0 && profile_page == 1) { @@ -349,6 +349,33 @@ } /* 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'); + } + } }); } @@ -401,19 +428,19 @@ function getPosition(e) { var cursor = {x:0, y:0}; - if ( e.pageX || e.pageY ) { - cursor.x = e.pageX; - cursor.y = e.pageY; + if ( e.touches[0].pageX || e.touches[0].pageY ) { + cursor.x = e.touches[0].pageX; + cursor.y = e.touches[0].pageY; } else { - if( e.clientX || e.clientY ) { - cursor.x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft; - cursor.y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop; + if( e.touches[0].clientX || e.touches[0].clientY ) { + cursor.x = e.touches[0].clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft; + cursor.y = e.touches[0].clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop; } else { - if( e.x || e.y ) { - cursor.x = e.x; - cursor.y = e.y; + if( e.touches[0].x || e.touches[0].y ) { + cursor.touches[0].x = e.touches[0].x; + cursor.touches[0].y = e.touches[0].y; } } } @@ -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('
' + data.desc + '
' + data.version + '
' + data.credits + '
' + theme + ''); + $j('#theme-preview').html('
' + data.desc + '
' + data.version + '
' + data.credits + '
'); }); }