]> git.mxchange.org Git - friendica.git/commitdiff
Only auto update when there is content
authorMichael <heluecht@pirati.ca>
Tue, 20 Oct 2020 20:43:51 +0000 (20:43 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 20 Oct 2020 20:43:51 +0000 (20:43 +0000)
include/conversation.php
view/js/main.js
view/templates/conversation.tpl
view/templates/threaded_conversation.tpl
view/theme/frio/templates/threaded_conversation.tpl
view/theme/quattro/templates/conversation.tpl
view/theme/quattro/templates/threaded_conversation.tpl
view/theme/vier/templates/threaded_conversation.tpl

index baf7633a779ef93ad42606adee1e2dc943e8bfa9..6adc00d0c40d795dad1e2fcfb7d03542dc36b2c2 100644 (file)
@@ -697,6 +697,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
                '$live_update' => $live_update_div,
                '$remove' => DI::l10n()->t('remove'),
                '$mode' => $mode,
+               '$update' => $update,
                '$user' => $a->user,
                '$threads' => $threads,
                '$dropping' => ($page_dropping ? DI::l10n()->t('Delete Selected Items') : False),
index b523ce6e70f43af10b9004537ce7958306719542..89c4e91f664bbd6873686e70d3d1f4b98c888034 100644 (file)
@@ -620,6 +620,12 @@ function liveUpdate(src) {
                in_progress = false;
                update_item = 0;
 
+               if (data.length < 100) {
+                       // console.log('No data ' + data.length + ':' + data);
+                       return;
+               }
+               // console.log('Got data: ' + data.length + ':' + data);
+
                $('.wall-item-body', data).imagesLoaded(function() {
                        updateConvItems(data);
 
index 5a4ca2d634082dd09d644a9ed0e6430864d43ecf..761a31a84226a737520ad28ebc81fdace8b6b853 100644 (file)
@@ -1,6 +1,4 @@
-
 {{$live_update nofilter}}
-
 {{foreach $threads as $thread}}
 <div id="tread-wrapper-{{$thread.id}}" class="tread-wrapper">
        {{foreach $thread.items as $item}}
@@ -18,7 +16,7 @@
        {{/foreach}}
 </div>
 {{/foreach}}
-
+{{if !$update}}
 <div id="conversation-end"></div>
 
 {{if $dropping}}
@@ -28,3 +26,4 @@
 </div>
 <div id="item-delete-selected-end"></div>
 {{/if}}
+{{/if}}
index d993c6b33b982cb59b74d939be5a5bef6de5be93..f4a47354ed20c75c6b53f4529faa8b9e2d8484db 100644 (file)
@@ -1,10 +1,8 @@
-
 {{$live_update nofilter}}
-
 {{foreach $threads as $thread}}
 {{include file="{{$thread.template}}" item=$thread}}
 {{/foreach}}
-
+{{if !$update}}
 <div id="conversation-end"></div>
 
 {{if $dropping}}
@@ -15,3 +13,4 @@
 <img id="item-delete-selected-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" />
 <div id="item-delete-selected-end"></div>
 {{/if}}
+{{/if}}
index f618da2817b6aa7cc41dcaf7a33dc4c4f23aed26..de5522fa9b5f6d50535836c2dd99d484de178c21 100644 (file)
@@ -1,8 +1,6 @@
-<script type="text/javascript" src="view/theme/frio/frameworks/jquery-color/jquery.color.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
+{{if !$update}}<script type="text/javascript" src="view/theme/frio/frameworks/jquery-color/jquery.color.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>{{/if}}
 {{if $mode == display}}<script type="text/javascript" src="view/theme/frio/js/mod_display.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>{{/if}}
-
 {{$live_update nofilter}}
-
 {{foreach $threads as $thread}}
 <hr class="sr-only" />
 <div id="tread-wrapper-{{$thread.uriid}}" class="tread-wrapper {{if $thread.threaded}}threaded{{/if}} {{$thread.toplevel}} {{$thread.network}} {{if $thread.thread_level==1}}panel-default panel{{/if}} {{if $thread.thread_level!=1}}comment-wrapper{{/if}}" style="{{if $item.thread_level>2}}margin-left: -15px; margin-right:-16px; margin-bottom:-16px;{{/if}}"><!-- panel -->
@@ -15,7 +13,7 @@
 
 </div><!--./tread-wrapper-->
 {{/foreach}}
-
+{{if !$update}}
 <div id="conversation-end"></div>
 
 {{if $dropping}}
@@ -24,3 +22,4 @@
 </button>
 <img id="item-delete-selected-rotator" class="like-rotator" src="images/rotator.gif" style="display: none;" />
 {{/if}}
+{{/if}}
index ce89d579ead49e867d09aa7f01dd40c304d64c98..7e7f8cea89e6a46e7886e698432a0f7be29887e8 100644 (file)
@@ -1,5 +1,4 @@
 {{$live_update nofilter}}
-
 {{foreach $threads as $thread}}
 <div id="tread-wrapper-{{$thread.id}}" class="tread-wrapper">
        {{foreach $thread.items as $item}}
@@ -23,7 +22,7 @@
        {{/foreach}}
 </div>
 {{/foreach}}
-
+{{if !$update}}
 <div id="conversation-end"></div>
 
 {{if $dropping}}
@@ -46,4 +45,4 @@
     $('#item-'+id).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 2000);
 </script>
 {{/if}}
-
+{{/if}}
index 33431361f6dfea82078c1289150b464ce8039d83..640ecbfd0d88175d15dffc791ac9573c2b201b83 100644 (file)
@@ -1,5 +1,4 @@
 {{$live_update nofilter}}
-
 {{foreach $threads as $thread}}
 
 <div id="tread-wrapper-{{$thread.uriid}}" class="tread-wrapper {{if $thread.threaded}}threaded{{/if}}  {{$thread.toplevel}} {{if $thread.toplevel}} h-entry  {{else}} u-comment h-cite {{/if}} {{$thread.network}}">
@@ -13,7 +12,7 @@
 
 </div>
 {{/foreach}}
-
+{{if !$update}}
 <div id="conversation-end"></div>
 
 {{if $dropping}}
@@ -37,4 +36,4 @@
     $('#item-'+id).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 2000);
 </script>
 {{/if}}
-
+{{/if}}
index 35807f99120011a174b753551ff405980e619593..de35497d2401fb8e5ec186e7565312449a6fd6ac 100644 (file)
@@ -1,5 +1,4 @@
 {{$live_update nofilter}}
-
 {{foreach $threads as $thread}}
 <hr class="sr-only" />
 <div id="tread-wrapper-{{$thread.uriid}}" class="tread-wrapper {{if $thread.threaded}}threaded{{/if}}  {{$thread.toplevel}} {{if $thread.toplevel}}h-entry{{/if}} {{$thread.network}}">
@@ -13,7 +12,7 @@
                
 </div>
 {{/foreach}}
-
+{{if !$update}}
 <div id="conversation-end"></div>
 
 {{if $dropping}}
@@ -37,4 +36,4 @@
     $('#item-'+id).animate(colWhite, 1000).animate(colShiny).animate(colWhite, 2000);   
 </script>
 {{/if}}
-
+{{/if}}