mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 15:07:02 +03:00
es5 -> es2015 (last stage)
Signature plugin fixes Add view decorator A large number of fixes
This commit is contained in:
parent
e88c193334
commit
17669b7be0
153 changed files with 21193 additions and 21115 deletions
|
|
@ -1,4 +1,6 @@
|
|||
|
||||
/* global RL_COMMUNITY */
|
||||
|
||||
import window from 'window';
|
||||
import _ from '_';
|
||||
import $ from '$';
|
||||
|
|
@ -167,9 +169,7 @@ let bAllowPdfPreview = !bMobileDevice;
|
|||
|
||||
if (bAllowPdfPreview && window.navigator && window.navigator.mimeTypes)
|
||||
{
|
||||
bAllowPdfPreview = !!_.find(window.navigator.mimeTypes, function(oType) {
|
||||
return oType && 'application/pdf' === oType.type;
|
||||
});
|
||||
bAllowPdfPreview = !!_.find(window.navigator.mimeTypes, (type) => type && 'application/pdf' === type.type);
|
||||
|
||||
if (!bAllowPdfPreview)
|
||||
{
|
||||
|
|
@ -203,33 +203,29 @@ export const keyScopeReal = ko.observable(KeyState.All);
|
|||
export const keyScopeFake = ko.observable(KeyState.All);
|
||||
|
||||
export const keyScope = ko.computed({
|
||||
owner: this,
|
||||
read: () => keyScopeFake(),
|
||||
write: function(sValue) {
|
||||
write: (value) => {
|
||||
|
||||
if (KeyState.Menu !== sValue)
|
||||
if (KeyState.Menu !== value)
|
||||
{
|
||||
if (KeyState.Compose === sValue)
|
||||
if (KeyState.Compose === value)
|
||||
{
|
||||
// disableKeyFilter
|
||||
key.filter = function() {
|
||||
return useKeyboardShortcuts();
|
||||
};
|
||||
key.filter = () => useKeyboardShortcuts();
|
||||
}
|
||||
else
|
||||
{
|
||||
// restoreKeyFilter
|
||||
key.filter = function(event) {
|
||||
key.filter = (event) => {
|
||||
|
||||
if (useKeyboardShortcuts())
|
||||
{
|
||||
var
|
||||
oElement = event.target || event.srcElement,
|
||||
sTagName = oElement ? oElement.tagName : '';
|
||||
const
|
||||
el = event.target || event.srcElement,
|
||||
tagName = el ? el.tagName.toUpperCase() : '';
|
||||
|
||||
sTagName = sTagName.toUpperCase();
|
||||
return !('INPUT' === sTagName || 'SELECT' === sTagName || 'TEXTAREA' === sTagName ||
|
||||
(oElement && 'DIV' === sTagName && ('editorHtmlArea' === oElement.className || 'true' === '' + oElement.contentEditable))
|
||||
return !('INPUT' === tagName || 'SELECT' === tagName || 'TEXTAREA' === tagName ||
|
||||
(el && 'DIV' === tagName && ('editorHtmlArea' === el.className || 'true' === '' + el.contentEditable))
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -237,24 +233,24 @@ export const keyScope = ko.computed({
|
|||
};
|
||||
}
|
||||
|
||||
keyScopeFake(sValue);
|
||||
keyScopeFake(value);
|
||||
if (dropdownVisibility())
|
||||
{
|
||||
sValue = KeyState.Menu;
|
||||
value = KeyState.Menu;
|
||||
}
|
||||
}
|
||||
|
||||
keyScopeReal(sValue);
|
||||
keyScopeReal(value);
|
||||
}
|
||||
});
|
||||
|
||||
keyScopeReal.subscribe(function(sValue) {
|
||||
keyScopeReal.subscribe((value) => {
|
||||
// window.console.log('keyScope=' + sValue); // DEBUG
|
||||
key.setScope(sValue);
|
||||
key.setScope(value);
|
||||
});
|
||||
|
||||
dropdownVisibility.subscribe(function(bValue) {
|
||||
if (bValue)
|
||||
dropdownVisibility.subscribe((value) => {
|
||||
if (value)
|
||||
{
|
||||
keyScope(KeyState.Menu);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue