fix cannot remove when animation disabled

This commit is contained in:
MaysWind
2020-12-28 02:22:01 +08:00
parent 7515799d57
commit dc6735dc66
5 changed files with 20 additions and 20 deletions
+4 -4
View File
@@ -206,7 +206,7 @@
<f7-button rasied fill color="red" <f7-button rasied fill color="red"
icon-f7="trash" icon-size="16px" icon-f7="trash" icon-size="16px"
:tooltip="$t('Remove Sub Account')" :tooltip="$t('Remove Sub Account')"
@click="removeSubAccount(subAccount)"> @click="removeSubAccount(subAccount, false)">
</f7-button> </f7-button>
</f7-card-header> </f7-card-header>
<f7-card-content class="no-safe-areas" :padding="false"> <f7-card-content class="no-safe-areas" :padding="false">
@@ -297,7 +297,7 @@
<f7-actions close-by-outside-click close-on-escape :opened="showDeleteActionSheet" @actions:closed="showDeleteActionSheet = false"> <f7-actions close-by-outside-click close-on-escape :opened="showDeleteActionSheet" @actions:closed="showDeleteActionSheet = false">
<f7-actions-group> <f7-actions-group>
<f7-actions-label>{{ $t('Are you sure you want to remove this sub account?') }}</f7-actions-label> <f7-actions-label>{{ $t('Are you sure you want to remove this sub account?') }}</f7-actions-label>
<f7-actions-button color="red" @click="removeSubAccount(subAccountToDelete)">{{ $t('Remove') }}</f7-actions-button> <f7-actions-button color="red" @click="removeSubAccount(subAccountToDelete, true)">{{ $t('Remove') }}</f7-actions-button>
</f7-actions-group> </f7-actions-group>
<f7-actions-group> <f7-actions-group>
<f7-actions-button bold close>{{ $t('Cancel') }}</f7-actions-button> <f7-actions-button bold close>{{ $t('Cancel') }}</f7-actions-button>
@@ -468,13 +468,13 @@ export default {
showBalanceSheet: false showBalanceSheet: false
}); });
}, },
removeSubAccount(subAccount) { removeSubAccount(subAccount, confirm) {
if (!subAccount) { if (!subAccount) {
this.$alert('An error has occurred'); this.$alert('An error has occurred');
return; return;
} }
if (!this.showDeleteActionSheet) { if (!confirm) {
this.subAccountToDelete = subAccount; this.subAccountToDelete = subAccount;
this.showDeleteActionSheet = true; this.showDeleteActionSheet = true;
return; return;
+4 -4
View File
@@ -167,7 +167,7 @@
</f7-swipeout-actions> </f7-swipeout-actions>
<f7-swipeout-actions right v-if="!sortable"> <f7-swipeout-actions right v-if="!sortable">
<f7-swipeout-button color="orange" close :text="$t('Edit')" @click="edit(account)"></f7-swipeout-button> <f7-swipeout-button color="orange" close :text="$t('Edit')" @click="edit(account)"></f7-swipeout-button>
<f7-swipeout-button color="red" class="padding-left padding-right" @click="remove(account)"> <f7-swipeout-button color="red" class="padding-left padding-right" @click="remove(account, false)">
<f7-icon f7="trash"></f7-icon> <f7-icon f7="trash"></f7-icon>
</f7-swipeout-button> </f7-swipeout-button>
</f7-swipeout-actions> </f7-swipeout-actions>
@@ -188,7 +188,7 @@
<f7-actions close-by-outside-click close-on-escape :opened="showDeleteActionSheet" @actions:closed="showDeleteActionSheet = false"> <f7-actions close-by-outside-click close-on-escape :opened="showDeleteActionSheet" @actions:closed="showDeleteActionSheet = false">
<f7-actions-group> <f7-actions-group>
<f7-actions-label>{{ $t('Are you sure you want to delete this account?') }}</f7-actions-label> <f7-actions-label>{{ $t('Are you sure you want to delete this account?') }}</f7-actions-label>
<f7-actions-button color="red" @click="remove(accountToDelete)">{{ $t('Delete') }}</f7-actions-button> <f7-actions-button color="red" @click="remove(accountToDelete, true)">{{ $t('Delete') }}</f7-actions-button>
</f7-actions-group> </f7-actions-group>
<f7-actions-group> <f7-actions-group>
<f7-actions-button bold close>{{ $t('Cancel') }}</f7-actions-button> <f7-actions-button bold close>{{ $t('Cancel') }}</f7-actions-button>
@@ -649,7 +649,7 @@ export default {
} }
}); });
}, },
remove(account) { remove(account, confirm) {
const self = this; const self = this;
const app = self.$f7; const app = self.$f7;
const $$ = app.$; const $$ = app.$;
@@ -659,7 +659,7 @@ export default {
return; return;
} }
if (!self.showDeleteActionSheet) { if (!confirm) {
self.accountToDelete = account; self.accountToDelete = account;
self.showDeleteActionSheet = true; self.showDeleteActionSheet = true;
return; return;
+4 -4
View File
@@ -58,7 +58,7 @@
</f7-swipeout-actions> </f7-swipeout-actions>
<f7-swipeout-actions right v-if="!sortable"> <f7-swipeout-actions right v-if="!sortable">
<f7-swipeout-button color="orange" close :text="$t('Edit')" @click="edit(category)"></f7-swipeout-button> <f7-swipeout-button color="orange" close :text="$t('Edit')" @click="edit(category)"></f7-swipeout-button>
<f7-swipeout-button color="red" class="padding-left padding-right" @click="remove(category)"> <f7-swipeout-button color="red" class="padding-left padding-right" @click="remove(category, false)">
<f7-icon f7="trash"></f7-icon> <f7-icon f7="trash"></f7-icon>
</f7-swipeout-button> </f7-swipeout-button>
</f7-swipeout-actions> </f7-swipeout-actions>
@@ -79,7 +79,7 @@
<f7-actions close-by-outside-click close-on-escape :opened="showDeleteActionSheet" @actions:closed="showDeleteActionSheet = false"> <f7-actions close-by-outside-click close-on-escape :opened="showDeleteActionSheet" @actions:closed="showDeleteActionSheet = false">
<f7-actions-group> <f7-actions-group>
<f7-actions-label>{{ $t('Are you sure you want to delete this category?') }}</f7-actions-label> <f7-actions-label>{{ $t('Are you sure you want to delete this category?') }}</f7-actions-label>
<f7-actions-button color="red" @click="remove(categoryToDelete)">{{ $t('Delete') }}</f7-actions-button> <f7-actions-button color="red" @click="remove(categoryToDelete, true)">{{ $t('Delete') }}</f7-actions-button>
</f7-actions-group> </f7-actions-group>
<f7-actions-group> <f7-actions-group>
<f7-actions-button bold close>{{ $t('Cancel') }}</f7-actions-button> <f7-actions-button bold close>{{ $t('Cancel') }}</f7-actions-button>
@@ -379,7 +379,7 @@ export default {
} }
}); });
}, },
remove(category) { remove(category, confirm) {
const self = this; const self = this;
const app = self.$f7; const app = self.$f7;
const $$ = app.$; const $$ = app.$;
@@ -389,7 +389,7 @@ export default {
return; return;
} }
if (!self.showDeleteActionSheet) { if (!confirm) {
self.categoryToDelete = category; self.categoryToDelete = category;
self.showDeleteActionSheet = true; self.showDeleteActionSheet = true;
return; return;
+4 -4
View File
@@ -99,7 +99,7 @@
</f7-swipeout-actions> </f7-swipeout-actions>
<f7-swipeout-actions right v-if="!sortable && !tag.editing"> <f7-swipeout-actions right v-if="!sortable && !tag.editing">
<f7-swipeout-button color="orange" close :text="$t('Edit')" @click="edit(tag)"></f7-swipeout-button> <f7-swipeout-button color="orange" close :text="$t('Edit')" @click="edit(tag)"></f7-swipeout-button>
<f7-swipeout-button color="red" class="padding-left padding-right" @click="remove(tag)"> <f7-swipeout-button color="red" class="padding-left padding-right" @click="remove(tag, false)">
<f7-icon f7="trash"></f7-icon> <f7-icon f7="trash"></f7-icon>
</f7-swipeout-button> </f7-swipeout-button>
</f7-swipeout-actions> </f7-swipeout-actions>
@@ -120,7 +120,7 @@
<f7-actions close-by-outside-click close-on-escape :opened="showDeleteActionSheet" @actions:closed="showDeleteActionSheet = false"> <f7-actions close-by-outside-click close-on-escape :opened="showDeleteActionSheet" @actions:closed="showDeleteActionSheet = false">
<f7-actions-group> <f7-actions-group>
<f7-actions-label>{{ $t('Are you sure you want to delete this tag?') }}</f7-actions-label> <f7-actions-label>{{ $t('Are you sure you want to delete this tag?') }}</f7-actions-label>
<f7-actions-button color="red" @click="remove(tagToDelete)">{{ $t('Delete') }}</f7-actions-button> <f7-actions-button color="red" @click="remove(tagToDelete, true)">{{ $t('Delete') }}</f7-actions-button>
</f7-actions-group> </f7-actions-group>
<f7-actions-group> <f7-actions-group>
<f7-actions-button bold close>{{ $t('Cancel') }}</f7-actions-button> <f7-actions-button bold close>{{ $t('Cancel') }}</f7-actions-button>
@@ -440,7 +440,7 @@ export default {
} }
}); });
}, },
remove(tag) { remove(tag, confirm) {
const self = this; const self = this;
const app = self.$f7; const app = self.$f7;
const $$ = app.$; const $$ = app.$;
@@ -450,7 +450,7 @@ export default {
return; return;
} }
if (!self.showDeleteActionSheet) { if (!confirm) {
self.tagToDelete = tag; self.tagToDelete = tag;
self.showDeleteActionSheet = true; self.showDeleteActionSheet = true;
return; return;
+4 -4
View File
@@ -154,7 +154,7 @@
</div> </div>
<f7-swipeout-actions right> <f7-swipeout-actions right>
<f7-swipeout-button color="orange" close :text="$t('Edit')" @click="edit(transaction)"></f7-swipeout-button> <f7-swipeout-button color="orange" close :text="$t('Edit')" @click="edit(transaction)"></f7-swipeout-button>
<f7-swipeout-button color="red" class="padding-left padding-right" @click="remove(transaction)"> <f7-swipeout-button color="red" class="padding-left padding-right" @click="remove(transaction, false)">
<f7-icon f7="trash"></f7-icon> <f7-icon f7="trash"></f7-icon>
</f7-swipeout-button> </f7-swipeout-button>
</f7-swipeout-actions> </f7-swipeout-actions>
@@ -174,7 +174,7 @@
<f7-actions close-by-outside-click close-on-escape :opened="showDeleteActionSheet" @actions:closed="showDeleteActionSheet = false"> <f7-actions close-by-outside-click close-on-escape :opened="showDeleteActionSheet" @actions:closed="showDeleteActionSheet = false">
<f7-actions-group> <f7-actions-group>
<f7-actions-label>{{ $t('Are you sure you want to delete this transaction?') }}</f7-actions-label> <f7-actions-label>{{ $t('Are you sure you want to delete this transaction?') }}</f7-actions-label>
<f7-actions-button color="red" @click="remove(transactionToDelete)">{{ $t('Delete') }}</f7-actions-button> <f7-actions-button color="red" @click="remove(transactionToDelete, true)">{{ $t('Delete') }}</f7-actions-button>
</f7-actions-group> </f7-actions-group>
<f7-actions-group> <f7-actions-group>
<f7-actions-button bold close>{{ $t('Cancel') }}</f7-actions-button> <f7-actions-button bold close>{{ $t('Cancel') }}</f7-actions-button>
@@ -367,7 +367,7 @@ export default {
edit(transaction) { edit(transaction) {
this.$f7router.navigate('/transaction/edit?id=' + transaction.id); this.$f7router.navigate('/transaction/edit?id=' + transaction.id);
}, },
remove(transaction) { remove(transaction, confirm) {
const self = this; const self = this;
const app = self.$f7; const app = self.$f7;
const $$ = app.$; const $$ = app.$;
@@ -377,7 +377,7 @@ export default {
return; return;
} }
if (!self.showDeleteActionSheet) { if (!confirm) {
self.transactionToDelete = transaction; self.transactionToDelete = transaction;
self.showDeleteActionSheet = true; self.showDeleteActionSheet = true;
return; return;