basic cancel event dispatch from ImportRunnerModal

ref #13
This commit is contained in:
Philipp Dormann 2021-01-20 18:15:47 +01:00
parent ecad1ea839
commit cde4ec13ef
2 changed files with 12 additions and 1 deletions

View File

@ -6,8 +6,14 @@
import { focusTrap } from "svelte-focus-trap";
import Toastify from "toastify-js";
import { ImportService } from "@odit/lfk-client-js";
import { createEventDispatcher } from "svelte";
export let import_modal_open;
$: searchvalue = "";
const dispatch = createEventDispatcher();
function cancelModal() {
import_modal_open = false;
dispatch("cancel");
}
(() => {
document.onkeydown = (e) => {
e = e || window.event;
@ -206,6 +212,7 @@
<button
on:click={() => {
json_output = [];
cancelModal();
}}
type="button"
class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm">

View File

@ -39,5 +39,9 @@
{#if store.state.jwtinfo.userdetails.permissions.includes('ORGANISATION:CREATE')}
<AddOrgModal bind:current_organizations bind:modal_open />
<ImportRunnerModal bind:import_modal_open />
<ImportRunnerModal
on:cancelDelete={(event) => {
import_modal_open = false;
}}
bind:import_modal_open />
{/if}