forked from trent_larson/crowd-funder-for-time-pwa
fix bad link to project page, fix improper action on invite-add-contact cancel
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
<template>
|
||||
<div v-if="visible" class="dialog-overlay">
|
||||
<div class="dialog">
|
||||
<h1 class="text-xl font-bold text-center mb-4">Contact Name</h1>
|
||||
<h1 class="text-xl font-bold text-center mb-4">{{ title }}</h1>
|
||||
{{ message }}
|
||||
Note that their name is only stored on this device.
|
||||
<input
|
||||
type="text"
|
||||
@@ -38,23 +39,38 @@ import { Vue, Component } from "vue-facing-decorator";
|
||||
|
||||
@Component
|
||||
export default class ContactNameDialog extends Vue {
|
||||
callback: (name?: string) => void = () => {};
|
||||
cancelCallback: () => void = () => {};
|
||||
saveCallback: (name?: string) => void = () => {};
|
||||
message = "";
|
||||
newText = "";
|
||||
title = "Contact Name";
|
||||
visible = false;
|
||||
|
||||
async open(aCallback?: (name?: string) => void) {
|
||||
this.callback = aCallback || this.callback;
|
||||
async open(
|
||||
title?: string,
|
||||
message?: string,
|
||||
saveCallback?: (name: string) => void,
|
||||
cancelCallback?: () => void,
|
||||
) {
|
||||
this.cancelCallback = cancelCallback || this.cancelCallback;
|
||||
this.saveCallback = saveCallback || this.saveCallback;
|
||||
this.message = message ?? this.message;
|
||||
this.title = title ?? this.title;
|
||||
this.visible = true;
|
||||
}
|
||||
|
||||
async onClickSaveChanges() {
|
||||
this.visible = false;
|
||||
this.callback(this.newText);
|
||||
if (this.saveCallback) {
|
||||
this.saveCallback(this.newText);
|
||||
}
|
||||
}
|
||||
|
||||
onClickCancel() {
|
||||
this.visible = false;
|
||||
this.callback();
|
||||
if (this.cancelCallback) {
|
||||
this.cancelCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user