Cleanup __APP__/getApp code

This commit is contained in:
djmaze 2020-09-15 09:29:25 +02:00
parent 29cf711a6a
commit b904eca98e
34 changed files with 86 additions and 146 deletions

View file

@ -18,7 +18,7 @@ export const useKeyboardShortcuts = ko.observable(true);
* @type {boolean}
*/
export const bMobileDevice = (/android|iphone|ipod|ipad|blackberry|mobile/i).test(
(window.navigator && navigator.userAgent && navigator.userAgent.toLowerCase()) || ''
(navigator.userAgent && navigator.userAgent.toLowerCase()) || ''
);
export const VIEW_MODELS = {
@ -59,14 +59,14 @@ export const keyScope = ko.computed({
// restoreKeyFilter
key.filter = (event) => {
if (useKeyboardShortcuts()) {
const el = event.target || event.srcElement,
tagName = el ? el.tagName.toUpperCase() : '';
const el = event.target,
nodeName = el ? el.nodeName : '';
return !(
'INPUT' === tagName ||
'SELECT' === tagName ||
'TEXTAREA' === tagName ||
(el && 'DIV' === tagName && ('editorHtmlArea' === el.className || 'true' === '' + el.contentEditable))
'INPUT' === nodeName ||
'SELECT' === nodeName ||
'TEXTAREA' === nodeName ||
(el && el.contentEditable)
);
}
@ -96,10 +96,3 @@ dropdownVisibility.subscribe((value) => {
keyScope(keyScopeFake());
}
});
/**
* @type {*}
*/
export const data = {
__APP__: null
};