mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Remove infinite spinning icon for reset parameters dropdown and add a question mark (#3603)
* Add question mark to popup words * Remove spinning icon * Formatting
This commit is contained in:
parent
f345517dcc
commit
a4626bf48e
2 changed files with 3 additions and 26 deletions
|
@ -315,7 +315,7 @@ deck-config-confirm-remove-name = Remove { $name }?
|
|||
deck-config-save-button = Save
|
||||
deck-config-save-to-all-subdecks = Save to All Subdecks
|
||||
deck-config-save-and-optimize = Optimize All Presets
|
||||
deck-config-revert-button-tooltip = Restore this setting to its default value.
|
||||
deck-config-revert-button-tooltip = Restore this setting to its default value?
|
||||
|
||||
## These strings are shown via the Description button at the bottom of the
|
||||
## overview screen.
|
||||
|
|
|
@ -5,12 +5,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
<script lang="ts">
|
||||
import * as tr from "@generated/ftl";
|
||||
import { cloneDeep, isEqual as isEqualLodash } from "lodash-es";
|
||||
import { getContext } from "svelte";
|
||||
|
||||
import { revertIcon } from "$lib/components/icons";
|
||||
|
||||
import Badge from "./Badge.svelte";
|
||||
import { touchDeviceKey } from "./context-keys";
|
||||
import DropdownItem from "./DropdownItem.svelte";
|
||||
import Icon from "./Icon.svelte";
|
||||
import Popover from "./Popover.svelte";
|
||||
|
@ -38,8 +36,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
|
||||
let showFloating = false;
|
||||
|
||||
const isTouchDevice = getContext<boolean>(touchDeviceKey);
|
||||
|
||||
function revert(): void {
|
||||
value = cloneDeep(defaultValue);
|
||||
showFloating = false;
|
||||
|
@ -68,32 +64,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
</div>
|
||||
|
||||
<Popover slot="floating">
|
||||
<DropdownItem
|
||||
class={`spinner ${isTouchDevice ? "spin-always" : ""}`}
|
||||
on:click={() => revert()}
|
||||
>
|
||||
{tr.deckConfigRevertButtonTooltip()}<Badge iconSize={85}>
|
||||
<Icon icon={revertIcon} />
|
||||
</Badge>
|
||||
<DropdownItem on:click={() => revert()}>
|
||||
{tr.deckConfigRevertButtonTooltip()}
|
||||
</DropdownItem>
|
||||
</Popover>
|
||||
</WithFloating>
|
||||
|
||||
<style lang="scss">
|
||||
:global(.spinner:hover .badge, .spinner.spin-always .badge) {
|
||||
animation: spin-animation 1s infinite;
|
||||
animation-timing-function: linear;
|
||||
}
|
||||
|
||||
@keyframes -global-spin-animation {
|
||||
0% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
}
|
||||
|
||||
:global(.badge) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue