Make it possible to show less log entries again - fix owncloud/core#1593
* show "less" button only if there are more than 3 entries * only "remove" logs till last 3 entries
This commit is contained in:
parent
0c666cb764
commit
d3ca97dd2f
|
@ -26,9 +26,22 @@ OC.Log={
|
||||||
if(!result.remain){
|
if(!result.remain){
|
||||||
$('#moreLog').css('display', 'none');
|
$('#moreLog').css('display', 'none');
|
||||||
}
|
}
|
||||||
|
$('#lessLog').css('display', '');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
showLess:function(count){
|
||||||
|
count = count || 10;
|
||||||
|
$('#moreLog').css('display', '');
|
||||||
|
$('html, body').animate({scrollTop: $(document).height()}, 800);
|
||||||
|
while(OC.Log.loaded > 3 && count){
|
||||||
|
$('#log tr').last().remove()
|
||||||
|
OC.Log.loaded -= 1;
|
||||||
|
count--;
|
||||||
|
}
|
||||||
|
if(OC.Log.loaded <= 3)
|
||||||
|
$('#lessLog').css('display', 'none');
|
||||||
|
},
|
||||||
addEntries:function(entries){
|
addEntries:function(entries){
|
||||||
for(var i=0;i<entries.length;i++){
|
for(var i=0;i<entries.length;i++){
|
||||||
var entry=entries[i];
|
var entry=entries[i];
|
||||||
|
@ -58,4 +71,7 @@ $(document).ready(function(){
|
||||||
$('#moreLog').click(function(){
|
$('#moreLog').click(function(){
|
||||||
OC.Log.getMore();
|
OC.Log.getMore();
|
||||||
})
|
})
|
||||||
|
$('#lessLog').click(function(){
|
||||||
|
OC.Log.showLess();
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
|
@ -221,6 +221,7 @@ endfor;?>
|
||||||
</table>
|
</table>
|
||||||
<?php if ($_['entriesremain']): ?>
|
<?php if ($_['entriesremain']): ?>
|
||||||
<input id='moreLog' type='button' value='<?php p($l->t('More'));?>...'>
|
<input id='moreLog' type='button' value='<?php p($l->t('More'));?>...'>
|
||||||
|
<input id='lessLog' type='button' style='display:none' value='<?php p($l->t('Less'));?>...'>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
Loading…
Reference in New Issue