PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 3.6.61
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v3.6.61
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / resources / assets / admin / components / modals / AddFormModal.vue

AddFormModal.vue in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 3.6.61, at resources/assets/admin/components/modals/AddFormModal.vue

89 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <template>
2 <div :class="{'ff_backdrop': visibility}">
3 <el-dialog :visible="visibility" :before-close="close">
4 <span slot="title" class="el-dialog__title">
5 Add a New Form
6 </span>
7 <el-form :model="{}" label-position="top" @submit.native.prevent="add">
8 <el-form-item label="Your Form Name">
9 <el-input class="addNewForm" v-model="form_title" type="text" placeholder="Awesome Form"></el-input>
10 </el-form-item>
11 </el-form>
12
13 <span slot="footer" class="dialog-footer">
14 <el-button @click="close">Cancel</el-button>
15 <el-button :loading="loading" type="primary" @click="add">
16 <span v-if="loading">Creating Form...</span>
17 <span v-else>Add Form</span>
18 </el-button>
19 </span>
20 </el-dialog>
21 </div>
22 </template>
23
24 <script>
25 export default {
26 name: 'AddFormModal',
27 props: {
28 visibility: Boolean
29 },
30 data() {
31 return {
32 loading: false,
33 status: 'published',
34 templates: {
35 blank: 'Blank Form',
36 contact: 'Contact Form',
37 support: 'Support Form',
38 eventRegistration: 'Event Registration',
39 },
40 template: '',
41 form_title: ''
42 }
43 },
44 methods: {
45 close() {
46 this.$emit('update:visibility', false);
47 },
48 add() {
49 this.loading = true;
50 let data = {
51 action: this.$action.saveForm,
52 type: this.template,
53 title: this.form_title,
54 status: this.status
55 };
56
57 jQuery.post(ajaxurl, data)
58 .then((response) => {
59 this.$notify.success({
60 title: 'Congratulations!',
61 message: response.data.message,
62 offset: 30
63 });
64 window.location.href = response.data.redirect_url;
65 })
66 .fail(error => {
67 this.$message.error('Please Provide the form name');
68 })
69 .always(() => {
70 this.loading = false;
71 })
72 }
73 },
74 watch: {
75 visibility() {
76 if (this.visibility)
77 this.$nextTick( _ => jQuery('.addNewForm input').focus());
78 }
79 }
80 }
81 </script>
82
83 <style>
84 small {
85 font-weight: normal;
86 font-size: 13px;
87 margin-left: 15px;
88 }
89 </style>