Bugfix: when left panel disabled and dragstart messages, show panel

This commit is contained in:
the-djmaze
2022-11-22 11:14:56 +01:00
parent 1032d0eb45
commit 434ac21103
7 changed files with 21 additions and 18 deletions

View File

@@ -18,7 +18,6 @@ export const
dropdowns = [],
dropdownVisibility = ko.observable(false).extend({ rateLimit: 0 }),
moveAction = ko.observable(false),
leftPanelDisabled = ko.observable(false),
toggleLeftPanel = () => leftPanelDisabled(!leftPanelDisabled()),
@@ -69,9 +68,4 @@ dropdownVisibility.subscribe(value => {
}
});
leftPanelDisabled.subscribe(value => {
value && moveAction() && moveAction(false);
$htmlCL.toggle('rl-left-panel-disabled', value);
});
moveAction.subscribe(value => value && leftPanelDisabled(false));
leftPanelDisabled.subscribe(value => $htmlCL.toggle('rl-left-panel-disabled', value));

View File

@@ -1,7 +1,7 @@
import { MessageFlagsCache } from 'Common/Cache';
import { Notification } from 'Common/Enums';
import { MessageSetAction, ComposeType/*, FolderType*/ } from 'Common/EnumsUser';
import { doc, createElement, elementById, dropdowns, dropdownVisibility, SettingsGet } from 'Common/Globals';
import { doc, createElement, elementById, dropdowns, dropdownVisibility, SettingsGet, leftPanelDisabled } from 'Common/Globals';
import { plainToHtml } from 'Common/Html';
import { getNotification } from 'Common/Translator';
import { EmailModel } from 'Model/Email';
@@ -15,6 +15,8 @@ import Remote from 'Remote/User/Fetch';
export const
moveAction = ko.observable(false),
dropdownsDetectVisibility = (() =>
dropdownVisibility(!!dropdowns.find(item => item.classList.contains('show')))
).debounce(50),
@@ -356,3 +358,6 @@ populateMessageBody = (oMessage, popup) => {
}, oMessage.folder, oMessage.uid);
}
};
leftPanelDisabled.subscribe(value => value && moveAction(false));
moveAction.subscribe(value => value && leftPanelDisabled(false));

View File

@@ -3,7 +3,7 @@ import ko from 'ko';
import { HtmlEditor } from 'Common/Html';
import { timeToNode } from 'Common/Translator';
import { doc, elementById, addEventsListeners, dropdowns } from 'Common/Globals';
import { dropdownsDetectVisibility } from 'Common/UtilsUser';
import { dropdownsDetectVisibility, moveAction } from 'Common/UtilsUser';
import { EmailAddressesComponent } from 'Component/EmailAddresses';
import { ThemeStore } from 'Stores/Theme';
import { moveMessagesToFolder, dropFilesInFolder } from 'Common/Folders';
@@ -144,12 +144,17 @@ Object.assign(ko.bindingHandlers, {
// Remove the Chrome visibility
dragImage.style.cssText = '';
moveAction(true);
} else {
e.preventDefault();
}
}, false);
element.addEventListener("dragend", () => dragData = null);
element.addEventListener("dragend", () => {
dragData = null;
moveAction(false);
});
}
},

View File

@@ -1,8 +1,8 @@
import { Scope } from 'Common/Enums';
import { Layout, ClientSideKeyNameMessageListSize } from 'Common/EnumsUser';
import { doc, createElement, leftPanelDisabled, moveAction, Settings, elementById } from 'Common/Globals';
import { doc, createElement, leftPanelDisabled, Settings, elementById } from 'Common/Globals';
import { pString, pInt } from 'Common/Utils';
import { setLayoutResizer } from 'Common/UtilsUser';
import { setLayoutResizer, moveAction } from 'Common/UtilsUser';
import { getFolderFromCacheList, getFolderFullName, getFolderInboxName } from 'Common/Cache';
import { i18n, initOnStartOrLangChange } from 'Common/Translator';
import { SettingsUserStore } from 'Stores/User/Settings';

View File

@@ -1,7 +1,7 @@
import ko from 'ko';
import { Scope } from 'Common/Enums';
import { moveAction, addShortcut } from 'Common/Globals';
import { addShortcut } from 'Common/Globals';
import { mailBox, settings } from 'Common/Links';
//import { setFolderHash } from 'Common/Cache';
import { addComputablesTo } from 'External/ko';
@@ -15,7 +15,7 @@ import { MessagelistUserStore } from 'Stores/User/Messagelist';
import { showScreenPopup } from 'Knoin/Knoin';
import { AbstractViewLeft } from 'Knoin/AbstractViews';
import { showMessageComposer } from 'Common/UtilsUser';
import { showMessageComposer, moveAction } from 'Common/UtilsUser';
import { FolderCreatePopupView } from 'View/Popup/FolderCreate';
import { ContactsPopupView } from 'View/Popup/Contacts';
import { ComposePopupView } from 'View/Popup/Compose';

View File

@@ -5,13 +5,13 @@ import { Scope } from 'Common/Enums';
import { ComposeType, FolderType, MessageSetAction } from 'Common/EnumsUser';
import { leftPanelDisabled, toggleLeftPanel, moveAction,
import { leftPanelDisabled, toggleLeftPanel,
Settings, SettingsCapa,
addEventsListeners,
addShortcut, registerShortcut, formFieldFocused
} from 'Common/Globals';
import { computedPaginatorHelper, showMessageComposer, populateMessageBody, download } from 'Common/UtilsUser';
import { computedPaginatorHelper, showMessageComposer, populateMessageBody, download, moveAction } from 'Common/UtilsUser';
import { FileInfo } from 'Common/File';
import { isFullscreen, toggleFullscreen } from 'Common/Fullscreen';

View File

@@ -15,7 +15,6 @@ import {
elementById,
leftPanelDisabled,
keyScopeReal,
moveAction,
Settings,
SettingsCapa,
fireEvent,
@@ -24,7 +23,7 @@ import {
} from 'Common/Globals';
import { arrayLength } from 'Common/Utils';
import { download, mailToHelper, showMessageComposer } from 'Common/UtilsUser';
import { download, mailToHelper, showMessageComposer, moveAction } from 'Common/UtilsUser';
import { isFullscreen, exitFullscreen, toggleFullscreen } from 'Common/Fullscreen';
import { SMAudio } from 'Common/Audio';