fixed BUG-78 (deleted recursively too far - took out parent_dir), also deleting from the viewer page works with Delete key too. Removed debugs in viewer for fullscreen

This commit is contained in:
2022-01-14 13:49:39 +11:00
parent 3678a5892f
commit bd7cae6037
4 changed files with 22 additions and 40 deletions

View File

@@ -236,7 +236,8 @@
<button class="btn btn-outline-info p-1" title="View in Fullscreen mode (hotkey: F)" onClick="fullscreen=true; ViewImageOrVideo()">
<svg width="28" height="28" fill="currentColor"><use xlink:href="{{url_for('internal', filename='icons.svg')}}#fullscreen"/></svg>
</button>
<button class="btn btn-outline-danger p-1" title="Delete (hotkey: Del)" onClick="alert('not yet')">
<button id="del" class="btn btn-outline-danger p-1" title="Delete (hotkey: Del)"
onClick="$.ajax({ type: 'POST', data: '&eid-0={{current}}', url: '/delete_files', success: function(data){ window.location='/'; return false; } })">
<svg width="28" height="28" fill="currentColor"><use xlink:href="{{url_for('internal', filename='icons.svg')}}#trash"/></svg>
</button>
</div>
@@ -270,18 +271,17 @@ $( document ).keydown(function(event) {
fullscreen=!document.fullscreen
ViewImageOrVideo()
break;
case "Delete":
$('#del').click()
default:
return; // Quit when this doesn't handle the key event.
}
});
console.log('here in viewer: fs = {{OPT.fullscreen}}')
var fullscreen=false;
{% if OPT.fullscreen=='true' %}
console.log('fs is set')
fullscreen=true;
ViewImageOrVideo()
console.log('have called view image, etc.')
{% endif %}
</script>
{% endblock script_content %}