Skip to content

Commit

Permalink
Fix page builder delete check - lyrasoft/primax#308
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed May 17, 2024
1 parent 9b8f7ca commit c32d1da
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
11 changes: 8 additions & 3 deletions assets/src/vue/components/page-builder/Addon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,14 @@ export default {
emit('duplicate');
}
function remove() {
u.confirm('Are you sure to delete it?')
.then(() => emit('delete'));
async function remove() {
const v = await u.confirm('Are you sure you want to delete??');
if (v) {
emit('delete');
}
return v;
}
// function addAddon() {
Expand Down
11 changes: 8 additions & 3 deletions assets/src/vue/components/page-builder/Column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,14 @@ function toggleDisabled() {
content.value.disabled = !content.value.disabled;
}
function remove() {
u.confirm('Are you sure you want to delete?')
.then(() => emit('delete'));
async function remove() {
const v = await u.confirm('Are you sure you want to delete??');
if (v) {
emit('delete');
}
return v;
}
function duplicateThisAddon(item, i) {
Expand Down
11 changes: 8 additions & 3 deletions assets/src/vue/components/page-builder/Row.vue
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,14 @@ function toggleDisabled() {
content.value.disabled = !content.value.disabled;
}
function remove() {
u.confirm('Are you sure you want to delete??')
.then(() => emit('delete'));
async function remove() {
const v = await u.confirm('Are you sure you want to delete??');
if (v) {
emit('delete');
}
return v;
}
function getEmptyRow() {
Expand Down

0 comments on commit c32d1da

Please sign in to comment.