mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Bugfix: rl.app.setExpandedFolder() undefined
This commit is contained in:
parent
661cd2aaf9
commit
bb4ff4fdc7
3 changed files with 22 additions and 24 deletions
3
dev/External/User/ko.js
vendored
3
dev/External/User/ko.js
vendored
|
|
@ -7,6 +7,7 @@ import { isArray } from 'Common/Utils';
|
||||||
import { EmailAddressesComponent } from 'Component/EmailAddresses';
|
import { EmailAddressesComponent } from 'Component/EmailAddresses';
|
||||||
import { ThemeStore } from 'Stores/Theme';
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
import { moveMessagesToFolder } from 'Common/Folders';
|
import { moveMessagesToFolder } from 'Common/Folders';
|
||||||
|
import { setExpandedFolder } from 'Model/FolderCollection';
|
||||||
|
|
||||||
const rlContentType = 'snappymail/action',
|
const rlContentType = 'snappymail/action',
|
||||||
|
|
||||||
|
|
@ -133,7 +134,7 @@ ko.bindingHandlers.dropmessages = {
|
||||||
if (folder && folder.collapsed()) {
|
if (folder && folder.collapsed()) {
|
||||||
dragTimer.start(() => {
|
dragTimer.start(() => {
|
||||||
folder.collapsed(false);
|
folder.collapsed(false);
|
||||||
rl.app.setExpandedFolder(folder.fullName, true);
|
setExpandedFolder(folder.fullName, true);
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,25 @@ const
|
||||||
};
|
};
|
||||||
|
|
||||||
export const
|
export const
|
||||||
|
/**
|
||||||
|
* @param {string} sFullName
|
||||||
|
* @param {boolean} bExpanded
|
||||||
|
*/
|
||||||
|
setExpandedFolder = (sFullName, bExpanded) => {
|
||||||
|
let aExpandedList = Local.get(ClientSideKeyName.ExpandedFolders);
|
||||||
|
if (!isArray(aExpandedList)) {
|
||||||
|
aExpandedList = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bExpanded) {
|
||||||
|
aExpandedList.includes(sFullName) || aExpandedList.push(sFullName);
|
||||||
|
} else {
|
||||||
|
aExpandedList = aExpandedList.filter(value => value !== sFullName);
|
||||||
|
}
|
||||||
|
|
||||||
|
Local.set(ClientSideKeyName.ExpandedFolders, aExpandedList);
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -19,31 +19,9 @@ import { showMessageComposer } from 'Common/UtilsUser';
|
||||||
import { FolderCreatePopupView } from 'View/Popup/FolderCreate';
|
import { FolderCreatePopupView } from 'View/Popup/FolderCreate';
|
||||||
import { ContactsPopupView } from 'View/Popup/Contacts';
|
import { ContactsPopupView } from 'View/Popup/Contacts';
|
||||||
|
|
||||||
import { isArray } from 'Common/Utils';
|
|
||||||
import { ClientSideKeyName } from 'Common/EnumsUser';
|
|
||||||
import * as Local from 'Storage/Client';
|
|
||||||
|
|
||||||
import { moveMessagesToFolder } from 'Common/Folders';
|
import { moveMessagesToFolder } from 'Common/Folders';
|
||||||
|
|
||||||
/**
|
import { setExpandedFolder } from 'Model/FolderCollection';
|
||||||
* @param {string} sFullName
|
|
||||||
* @param {boolean} bExpanded
|
|
||||||
*/
|
|
||||||
function setExpandedFolder(sFullName, bExpanded) {
|
|
||||||
let aExpandedList = Local.get(ClientSideKeyName.ExpandedFolders);
|
|
||||||
if (!isArray(aExpandedList)) {
|
|
||||||
aExpandedList = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bExpanded) {
|
|
||||||
if (!aExpandedList.includes(sFullName))
|
|
||||||
aExpandedList.push(sFullName);
|
|
||||||
} else {
|
|
||||||
aExpandedList = aExpandedList.filter(value => value !== sFullName);
|
|
||||||
}
|
|
||||||
|
|
||||||
Local.set(ClientSideKeyName.ExpandedFolders, aExpandedList);
|
|
||||||
}
|
|
||||||
|
|
||||||
export class MailFolderList extends AbstractViewLeft {
|
export class MailFolderList extends AbstractViewLeft {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue