Add sorting to Quick Links
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import Island from '$lib/islands/island.svelte';
|
||||
import { ql } from '$lib/stores/quick-links.js';
|
||||
import { ql } from '$lib/stores/quick-links';
|
||||
export let variables = {
|
||||
title: 'Quick Links'
|
||||
};
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import Island from '$lib/islands/island.svelte';
|
||||
import { ql } from '$lib/stores/quick-links.js';
|
||||
import { ql } from '$lib/stores/quick-links';
|
||||
export let variables = {
|
||||
title: 'Quick Links'
|
||||
};
|
||||
|
||||
let qlData = [];
|
||||
let qlData: string[] = [];
|
||||
$: {
|
||||
qlData = $ql;
|
||||
console.log(qlData);
|
||||
@@ -13,16 +13,16 @@
|
||||
|
||||
let saveButton = 'Save';
|
||||
|
||||
async function timeout(ms) {
|
||||
async function timeout(ms: number): Promise<any> {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
async function saveQl() {
|
||||
// Fetch the content of all text entries within the island then run ql.set([ARRAY OF INPUT CONTENT])
|
||||
const inputs = document.getElementsByClassName('qlInput');
|
||||
let inputLinks = [];
|
||||
let inputLinks: string[] = [];
|
||||
for (let item of inputs) {
|
||||
let text = item?.value;
|
||||
let text = (<HTMLInputElement>item)?.value;
|
||||
if (text !== '') {
|
||||
inputLinks.push(text);
|
||||
}
|
||||
@@ -46,7 +46,7 @@
|
||||
ql.set(updatedQl);
|
||||
}
|
||||
|
||||
function handleClick(event) {
|
||||
function handleClick(event: any) {
|
||||
// Handle the click event here
|
||||
console.log('Island Clicked');
|
||||
// You can access the `variables` passed to the Island component here if needed
|
||||
|
||||
Reference in New Issue
Block a user