mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-09 06:28:28 +03:00
Bugfix: sort accounts drag & drop
This commit is contained in:
parent
165ac87685
commit
abaf5a96fa
3 changed files with 8 additions and 10 deletions
|
|
@ -89,7 +89,7 @@ export class UserSettingsAccounts /*extends AbstractViewSettings*/ {
|
|||
|
||||
accountsAndIdentitiesAfterMove() {
|
||||
Remote.request('AccountsAndIdentitiesSortOrder', null, {
|
||||
Accounts: AccountUserStore.getEmailAddresses().filter(v => v != SettingsGet('mainEmail')),
|
||||
Accounts: AccountUserStore.filter(item => item.isAdditional()).map(item => item.email),
|
||||
Identities: IdentityUserStore.map(item => (item ? item.id() : ""))
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@ import { addObservablesTo, koArrayWithDestroy } from 'External/ko';
|
|||
|
||||
export const AccountUserStore = koArrayWithDestroy();
|
||||
|
||||
AccountUserStore.getEmailAddresses = () => AccountUserStore.map(item => item.email);
|
||||
|
||||
addObservablesTo(AccountUserStore, {
|
||||
email: '',
|
||||
loading: false
|
||||
|
|
|
|||
|
|
@ -16,13 +16,13 @@
|
|||
<span data-i18n="SETTINGS_ACCOUNTS/BUTTON_ADD_ACCOUNT"></span>
|
||||
</a>
|
||||
<table class="table table-hover list-table accounts-list" data-bind="i18nUpdate: accounts">
|
||||
<tbody>
|
||||
<td></td>
|
||||
<td colspan="3" data-bind="text: mainEmail"></td>
|
||||
</tbody>
|
||||
<tbody data-bind="foreach: accounts">
|
||||
<!-- ko if:isAdditional -->
|
||||
<tr draggable="true" data-bind="sortableItem: { list: $root.accounts, afterMove: $root.accountsAndIdentitiesAfterMove }">
|
||||
<tr draggable="true" data-bind="attr: {draggable:isAdditional}, sortableItem: { list: $root.accounts, afterMove: $root.accountsAndIdentitiesAfterMove }">
|
||||
<!-- ko if:!isAdditional() -->
|
||||
<td></td>
|
||||
<td colspan="3" data-bind="text: displayName"></td>
|
||||
<!-- /ko -->
|
||||
<!-- ko if:isAdditional -->
|
||||
<td>
|
||||
<i class="fontastic drag-handle">⬍</i>
|
||||
</td>
|
||||
|
|
@ -39,8 +39,8 @@
|
|||
<td>
|
||||
<span class="delete fontastic" data-bind="visible: !askDelete(), click: function (oAccount) { $root.accountForDeletion(oAccount); }">🗑</span>
|
||||
</td>
|
||||
<!-- /ko -->
|
||||
</tr>
|
||||
<!-- /ko -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue