From 2a01d8c99192f7491dd369ac335270b2f0de1fa1 Mon Sep 17 00:00:00 2001 From: djmaze <> Date: Tue, 28 Dec 2021 14:48:20 +0100 Subject: [PATCH] Cleanup user-select --- dev/Knoin/AbstractViews.js | 1 - dev/Knoin/Knoin.js | 4 ---- dev/Screen/AbstractSettings.js | 9 +++++---- dev/Styles/Admin/Config.less | 2 ++ dev/Styles/Ui.less | 1 + dev/View/Popup/Account.js | 1 - dev/View/Popup/AddOpenPgpKey.js | 1 - dev/View/Popup/AdvancedSearch.js | 1 - dev/View/Popup/Ask.js | 1 - dev/View/Popup/ComposeOpenPgp.js | 1 - dev/View/Popup/Domain.js | 1 - dev/View/Popup/Filter.js | 1 - dev/View/Popup/FolderClear.js | 1 - dev/View/Popup/FolderCreate.js | 1 - dev/View/Popup/FolderSystem.js | 1 - dev/View/Popup/Languages.js | 1 - dev/View/Popup/MessageOpenPgp.js | 1 - dev/View/Popup/NewOpenPgpKey.js | 1 - dev/View/Popup/SieveScript.js | 1 - 19 files changed, 8 insertions(+), 23 deletions(-) diff --git a/dev/Knoin/AbstractViews.js b/dev/Knoin/AbstractViews.js index 08d348f1d..6981011de 100644 --- a/dev/Knoin/AbstractViews.js +++ b/dev/Knoin/AbstractViews.js @@ -12,7 +12,6 @@ class AbstractView { this.viewModelTemplateID = templateID; this.viewType = type; this.viewModelDom = null; - this.viewNoUserSelect = false; this.keyScope = { scope: Scope.None, diff --git a/dev/Knoin/Knoin.js b/dev/Knoin/Knoin.js index e254b43b2..134776b42 100644 --- a/dev/Knoin/Knoin.js +++ b/dev/Knoin/Knoin.js @@ -47,10 +47,6 @@ const vm.viewModelDom = vmDom; ViewModelClass.__dom = vmDom; - if (vm.viewNoUserSelect) { - vmDom.classList.add('g-ui-user-select-none'); - } - if (ViewType.Popup === position) { vm.cancelCommand = vm.closeCommand = createCommand(() => hideScreenPopup(ViewModelClass)); diff --git a/dev/Screen/AbstractSettings.js b/dev/Screen/AbstractSettings.js index 51a3cb4c4..b9b6b24fb 100644 --- a/dev/Screen/AbstractSettings.js +++ b/dev/Screen/AbstractSettings.js @@ -2,7 +2,7 @@ import ko from 'ko'; import { pString } from 'Common/Utils'; import { settings } from 'Common/Links'; -import { elementById } from 'Common/Globals'; +import { createElement, elementById } from 'Common/Globals'; import { AbstractScreen } from 'Knoin/AbstractScreen'; @@ -33,9 +33,10 @@ export class AbstractSettingsScreen extends AbstractScreen { } else { const vmPlace = elementById('rl-settings-subscreen'); if (vmPlace) { - viewModelDom = Element.fromHTML(''); + viewModelDom = createElement('div',{ + id: 'V-Settings-' + RoutedSettingsViewModel.name.replace(/(User|Admin)Settings/,''), + hidden: '' + }) vmPlace.append(viewModelDom); settingsScreen = new RoutedSettingsViewModel(); diff --git a/dev/Styles/Admin/Config.less b/dev/Styles/Admin/Config.less index 9c48017ac..68283efa6 100644 --- a/dev/Styles/Admin/Config.less +++ b/dev/Styles/Admin/Config.less @@ -1,5 +1,7 @@ #V-Settings-Config { + user-select: text; + em { display: block; } diff --git a/dev/Styles/Ui.less b/dev/Styles/Ui.less index 584a59ec7..6a7cb090e 100644 --- a/dev/Styles/Ui.less +++ b/dev/Styles/Ui.less @@ -1,4 +1,5 @@ +#rl-settings-subscreen, .g-ui-user-select-none { user-select: none; -webkit-touch-callout: none; diff --git a/dev/View/Popup/Account.js b/dev/View/Popup/Account.js index 438680d24..99d8e022a 100644 --- a/dev/View/Popup/Account.js +++ b/dev/View/Popup/Account.js @@ -8,7 +8,6 @@ import { AbstractViewPopup } from 'Knoin/AbstractViews'; class AccountPopupView extends AbstractViewPopup { constructor() { super('Account'); - this.viewNoUserSelect = true; this.addObservables({ isNew: true, diff --git a/dev/View/Popup/AddOpenPgpKey.js b/dev/View/Popup/AddOpenPgpKey.js index 9697c9d37..3855df629 100644 --- a/dev/View/Popup/AddOpenPgpKey.js +++ b/dev/View/Popup/AddOpenPgpKey.js @@ -6,7 +6,6 @@ import { AbstractViewPopup } from 'Knoin/AbstractViews'; class AddOpenPgpKeyPopupView extends AbstractViewPopup { constructor() { super('AddOpenPgpKey'); - this.viewNoUserSelect = true; this.addObservables({ key: '', diff --git a/dev/View/Popup/AdvancedSearch.js b/dev/View/Popup/AdvancedSearch.js index 9fcd70b0b..4f2eae169 100644 --- a/dev/View/Popup/AdvancedSearch.js +++ b/dev/View/Popup/AdvancedSearch.js @@ -11,7 +11,6 @@ import { FolderUserStore } from 'Stores/User/Folder'; class AdvancedSearchPopupView extends AbstractViewPopup { constructor() { super('AdvancedSearch'); - this.viewNoUserSelect = true; this.addObservables({ from: '', diff --git a/dev/View/Popup/Ask.js b/dev/View/Popup/Ask.js index 2472e9451..87b7e64e5 100644 --- a/dev/View/Popup/Ask.js +++ b/dev/View/Popup/Ask.js @@ -7,7 +7,6 @@ import { AbstractViewPopup } from 'Knoin/AbstractViews'; class AskPopupView extends AbstractViewPopup { constructor() { super('Ask'); - this.viewNoUserSelect = true; this.addObservables({ askDesc: '', diff --git a/dev/View/Popup/ComposeOpenPgp.js b/dev/View/Popup/ComposeOpenPgp.js index 877fd22b8..60096dadc 100644 --- a/dev/View/Popup/ComposeOpenPgp.js +++ b/dev/View/Popup/ComposeOpenPgp.js @@ -18,7 +18,6 @@ const KEY_NAME_SUBSTR = -8, class ComposeOpenPgpPopupView extends AbstractViewPopup { constructor() { super('ComposeOpenPgp'); - this.viewNoUserSelect = true; this.publicKeysOptionsCaption = i18nPGP('ADD_A_PUBLICK_KEY'); this.privateKeysOptionsCaption = i18nPGP('SELECT_A_PRIVATE_KEY'); diff --git a/dev/View/Popup/Domain.js b/dev/View/Popup/Domain.js index 62c1ba3cf..0c7bb48fb 100644 --- a/dev/View/Popup/Domain.js +++ b/dev/View/Popup/Domain.js @@ -30,7 +30,6 @@ const domainToParams = oDomain => ({ class DomainPopupView extends AbstractViewPopup { constructor() { super('Domain'); - this.viewNoUserSelect = true; this.addObservables(this.getDefaults()); this.addObservables({ diff --git a/dev/View/Popup/Filter.js b/dev/View/Popup/Filter.js index 912b1261b..f04faa1f3 100644 --- a/dev/View/Popup/Filter.js +++ b/dev/View/Popup/Filter.js @@ -16,7 +16,6 @@ import { folderListOptionsBuilder } from 'Common/UtilsUser'; class FilterPopupView extends AbstractViewPopup { constructor() { super('Filter'); - this.viewNoUserSelect = true; this.addObservables({ isNew: true, diff --git a/dev/View/Popup/FolderClear.js b/dev/View/Popup/FolderClear.js index b4ab4c84f..d80161ff4 100644 --- a/dev/View/Popup/FolderClear.js +++ b/dev/View/Popup/FolderClear.js @@ -11,7 +11,6 @@ import { AbstractViewPopup } from 'Knoin/AbstractViews'; class FolderClearPopupView extends AbstractViewPopup { constructor() { super('FolderClear'); - this.viewNoUserSelect = true; this.addObservables({ selectedFolder: null, diff --git a/dev/View/Popup/FolderCreate.js b/dev/View/Popup/FolderCreate.js index 83e63c5e7..26db48395 100644 --- a/dev/View/Popup/FolderCreate.js +++ b/dev/View/Popup/FolderCreate.js @@ -19,7 +19,6 @@ import { FolderModel } from 'Model/FolderCollection'; class FolderCreatePopupView extends AbstractViewPopup { constructor() { super('FolderCreate'); - this.viewNoUserSelect = true; this.addObservables({ folderName: '', diff --git a/dev/View/Popup/FolderSystem.js b/dev/View/Popup/FolderSystem.js index 4b52e1c60..ccd855018 100644 --- a/dev/View/Popup/FolderSystem.js +++ b/dev/View/Popup/FolderSystem.js @@ -13,7 +13,6 @@ import { AbstractViewPopup } from 'Knoin/AbstractViews'; class FolderSystemPopupView extends AbstractViewPopup { constructor() { super('FolderSystem'); - this.viewNoUserSelect = true; this.sChooseOnText = ''; this.sUnuseText = ''; diff --git a/dev/View/Popup/Languages.js b/dev/View/Popup/Languages.js index a7e476ce8..051c3e775 100644 --- a/dev/View/Popup/Languages.js +++ b/dev/View/Popup/Languages.js @@ -7,7 +7,6 @@ import { AbstractViewPopup } from 'Knoin/AbstractViews'; class LanguagesPopupView extends AbstractViewPopup { constructor() { super('Languages'); - this.viewNoUserSelect = true; this.fLang = null; this.userLanguage = ko.observable(''); diff --git a/dev/View/Popup/MessageOpenPgp.js b/dev/View/Popup/MessageOpenPgp.js index b9712e327..0f32e1228 100644 --- a/dev/View/Popup/MessageOpenPgp.js +++ b/dev/View/Popup/MessageOpenPgp.js @@ -9,7 +9,6 @@ import { AbstractViewPopup } from 'Knoin/AbstractViews'; class MessageOpenPgpPopupView extends AbstractViewPopup { constructor() { super('MessageOpenPgp'); - this.viewNoUserSelect = true; this.addObservables({ notification: '', diff --git a/dev/View/Popup/NewOpenPgpKey.js b/dev/View/Popup/NewOpenPgpKey.js index 69a807e2f..e12748652 100644 --- a/dev/View/Popup/NewOpenPgpKey.js +++ b/dev/View/Popup/NewOpenPgpKey.js @@ -8,7 +8,6 @@ import { AbstractViewPopup } from 'Knoin/AbstractViews'; class NewOpenPgpKeyPopupView extends AbstractViewPopup { constructor() { super('NewOpenPgpKey'); - this.viewNoUserSelect = true; this.addObservables({ email: '', diff --git a/dev/View/Popup/SieveScript.js b/dev/View/Popup/SieveScript.js index bc27f138e..33f7ddcb4 100644 --- a/dev/View/Popup/SieveScript.js +++ b/dev/View/Popup/SieveScript.js @@ -16,7 +16,6 @@ import { FilterPopupView } from 'View/Popup/Filter'; class SieveScriptPopupView extends AbstractViewPopup { constructor() { super('SieveScript'); - this.viewNoUserSelect = true; addObservablesTo(this, { saveError: false,