Remove shuffle button, because the toolbar is too full
This commit is contained in:
@@ -32,13 +32,7 @@ let list = list_struct
|
||||
let is_list = false
|
||||
let list_downloadable = false
|
||||
let file_preview
|
||||
|
||||
let list_navigator
|
||||
let list_shuffle = false
|
||||
let toggle_shuffle = () => {
|
||||
list_shuffle = !list_shuffle
|
||||
}
|
||||
|
||||
let sharebar
|
||||
let sharebar_visible = false
|
||||
let toggle_sharebar = () => {
|
||||
@@ -338,10 +332,8 @@ const keyboard_event = evt => {
|
||||
downloader.download_file() // S to download the current file
|
||||
}
|
||||
break
|
||||
case "r": // R to toggle list shuffle
|
||||
if (list_navigator) {
|
||||
toggle_shuffle()
|
||||
}
|
||||
case "r": // R to toggle the report window
|
||||
report_window.toggle()
|
||||
break
|
||||
case "c": // C to copy to clipboard
|
||||
copy_btn.copy()
|
||||
@@ -404,7 +396,6 @@ const keyboard_event = evt => {
|
||||
<ListNavigator
|
||||
bind:this={list_navigator}
|
||||
files={list.files}
|
||||
shuffle={list_shuffle}
|
||||
on:set_file={e => open_file_index(e.detail)}
|
||||
on:toggle_gallery={toggle_gallery}
|
||||
>
|
||||
@@ -468,21 +459,6 @@ const keyboard_event = evt => {
|
||||
<span>QR code</span>
|
||||
</button>
|
||||
|
||||
{#if is_list}
|
||||
<button
|
||||
class="toolbar_button"
|
||||
title="Go to a random file when pressing → or clicking the next file button"
|
||||
class:button_highlight={list_shuffle}
|
||||
on:click={toggle_shuffle}>
|
||||
<i class="icon">shuffle</i>
|
||||
{#if list_shuffle}
|
||||
<span>Shuffle ☑</span>
|
||||
{:else}
|
||||
<span>Shuffle ☐</span>
|
||||
{/if}
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
{#if view === "file"}
|
||||
<button
|
||||
class="toolbar_button"
|
||||
@@ -517,6 +493,15 @@ const keyboard_event = evt => {
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<button
|
||||
class="toolbar_button"
|
||||
title="Report this file as abusive"
|
||||
on:click={report_window.toggle}
|
||||
class:button_highlight={report_visible}>
|
||||
<i class="icon">flag</i>
|
||||
<span>Report</span>
|
||||
</button>
|
||||
|
||||
{#if !disable_download_button}
|
||||
<button
|
||||
class="toolbar_button"
|
||||
@@ -527,16 +512,6 @@ const keyboard_event = evt => {
|
||||
<span>E<u>m</u>bed</span>
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<button
|
||||
class="toolbar_button"
|
||||
title="Report this file as abusive"
|
||||
on:click={report_window.toggle}
|
||||
class:button_highlight={report_visible}>
|
||||
<i class="icon">flag</i>
|
||||
<span>Report</span>
|
||||
</button>
|
||||
<br/>
|
||||
</div>
|
||||
|
||||
<div bind:this={file_preview_background}
|
||||
|
@@ -4,23 +4,12 @@ import { createEventDispatcher } from "svelte";
|
||||
let dispatch = createEventDispatcher()
|
||||
|
||||
export let files = []
|
||||
export let shuffle = false
|
||||
let file_list_div
|
||||
let selected_file_index = 0
|
||||
|
||||
export const next = () => {
|
||||
if (shuffle) {
|
||||
rand_item()
|
||||
} else {
|
||||
dispatch("set_file", selected_file_index+1)
|
||||
}
|
||||
}
|
||||
export const prev = () => {
|
||||
dispatch("set_file", selected_file_index-1)
|
||||
}
|
||||
export const toggle_gallery = () => {
|
||||
dispatch("toggle_gallery")
|
||||
}
|
||||
export const next = () => dispatch("set_file", selected_file_index+1)
|
||||
export const prev = () => dispatch("set_file", selected_file_index-1)
|
||||
export const toggle_gallery = () => dispatch("toggle_gallery")
|
||||
|
||||
let history = []
|
||||
export const rand_item = () => {
|
||||
|
@@ -130,9 +130,12 @@ onDestroy(close_socket)
|
||||
.label {
|
||||
padding-left: 0.5em;
|
||||
text-align: left;
|
||||
font-size: 0.75em;
|
||||
line-height: 0.75em;
|
||||
margin-top: 0.5em;
|
||||
font-size: 0.8em;
|
||||
line-height: 0.8em;
|
||||
margin-top: 0.25em;
|
||||
}
|
||||
.stat {
|
||||
line-height: 1.4em;
|
||||
}
|
||||
@media (max-width: 800px) {
|
||||
.label {
|
||||
|
@@ -166,7 +166,7 @@ Toolbar.svelte and the .label max-width in FileStats.svelte */
|
||||
@media (max-width: 800px) {
|
||||
.toolbar {
|
||||
overflow-y: hidden;
|
||||
max-height: 2.5em;
|
||||
max-height: 2.2em;
|
||||
}
|
||||
.toolbar.expanded {
|
||||
overflow-y: scroll;
|
||||
|
Reference in New Issue
Block a user