Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85804650
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/components/confirm_modal/confirm_modal.js b/src/components/confirm_modal/confirm_modal.js
new file mode 100644
index 0000000000..bb5e9d979d
--- /dev/null
+++ b/src/components/confirm_modal/confirm_modal.js
@@ -0,0 +1,42 @@
+import DialogModal from '../dialog_modal/dialog_modal.vue'
+
+/**
+ * This component emits the following events:
+ * cancelled, emitted when the action should not be performed;
+ * accepted, emitted when the action should be performed;
+ *
+ * The caller should close this dialog after receiving any of the two events.
+ */
+const ConfirmModal = {
+ components: {
+ DialogModal
+ },
+ data: {
+ },
+ props: {
+ showing: {
+ type: Boolean
+ },
+ title: {
+ type: String
+ },
+ cancelText: {
+ type: String
+ },
+ confirmText: {
+ type: String
+ }
+ },
+ computed: {
+ },
+ methods: {
+ onCancel () {
+ this.$emit('cancelled')
+ },
+ onAccept () {
+ this.$emit('accepted')
+ }
+ }
+}
+
+export default ConfirmModal
diff --git a/src/components/confirm_modal/confirm_modal.vue b/src/components/confirm_modal/confirm_modal.vue
new file mode 100644
index 0000000000..250a6984bb
--- /dev/null
+++ b/src/components/confirm_modal/confirm_modal.vue
@@ -0,0 +1,28 @@
+<template>
+ <dialog-modal
+ v-if="showing"
+ :onCancel="onCancel"
+ >
+ <template v-slot:header>
+ <span v-text="title"></span>
+ </template>
+
+ <slot></slot>
+
+ <template v-slot:footer>
+ <button
+ class="btn button-default"
+ v-text="confirmText"
+ @click.prevent="onAccept"
+ ></button>
+
+ <button
+ class="btn button-default"
+ v-text="cancelText"
+ @click.prevent="onCancel"
+ ></button>
+ </template>
+ </dialog-modal>
+</template>
+
+<script src="./confirm_modal.js"></script>
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Oct 10, 12:42 PM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1785194
Default Alt Text
(1 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment