TF-3114 Hide rich text button when focusing on Name/Bcc to text input
This commit is contained in:
@@ -167,6 +167,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
|
|||||||
log('IdentityCreatorController::onInit():arguments: ${Get.arguments}');
|
log('IdentityCreatorController::onInit():arguments: ${Get.arguments}');
|
||||||
arguments = Get.arguments;
|
arguments = Get.arguments;
|
||||||
_beforeReconnectManager.addListener(onBeforeReconnect);
|
_beforeReconnectManager.addListener(onBeforeReconnect);
|
||||||
|
_initFocusListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -179,7 +180,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
|
|||||||
session = arguments!.session;
|
session = arguments!.session;
|
||||||
identity = arguments!.identity;
|
identity = arguments!.identity;
|
||||||
actionType.value = arguments!.actionType;
|
actionType.value = arguments!.actionType;
|
||||||
if (actionType.value == IdentityActionType.create
|
if (actionType.value == IdentityActionType.create
|
||||||
&& arguments!.publicAssetsInIdentityArguments == null
|
&& arguments!.publicAssetsInIdentityArguments == null
|
||||||
) {
|
) {
|
||||||
isLoadSignatureCompleted = true;
|
isLoadSignatureCompleted = true;
|
||||||
@@ -192,6 +193,28 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _initFocusListener() {
|
||||||
|
inputNameIdentityFocusNode.addListener(_onInputNameIdentityListener);
|
||||||
|
inputBccIdentityFocusNode.addListener(_onInputBccIdentityListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _removeFocusListener() {
|
||||||
|
inputNameIdentityFocusNode.removeListener(_onInputNameIdentityListener);
|
||||||
|
inputBccIdentityFocusNode.removeListener(_onInputBccIdentityListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onInputNameIdentityListener() {
|
||||||
|
if (inputNameIdentityFocusNode.hasFocus && PlatformInfo.isMobile) {
|
||||||
|
richTextMobileTabletController?.richTextController.hideRichTextView();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onInputBccIdentityListener() {
|
||||||
|
if (inputBccIdentityFocusNode.hasFocus && PlatformInfo.isMobile) {
|
||||||
|
richTextMobileTabletController?.richTextController.hideRichTextView();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void _checkPublicAssetCapability() {
|
void _checkPublicAssetCapability() {
|
||||||
if (CapabilityIdentifier.jmapPublicAsset.isSupported(session!, accountId!)) {
|
if (CapabilityIdentifier.jmapPublicAsset.isSupported(session!, accountId!)) {
|
||||||
PublicAssetBindings(PublicAssetArguments(session!, accountId!, identity: identity)).dependencies();
|
PublicAssetBindings(PublicAssetArguments(session!, accountId!, identity: identity)).dependencies();
|
||||||
@@ -243,6 +266,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
|
|||||||
void onClose() {
|
void onClose() {
|
||||||
log('IdentityCreatorController::onClose():');
|
log('IdentityCreatorController::onClose():');
|
||||||
isLoadSignatureCompleted = false;
|
isLoadSignatureCompleted = false;
|
||||||
|
_removeFocusListener();
|
||||||
inputNameIdentityFocusNode.dispose();
|
inputNameIdentityFocusNode.dispose();
|
||||||
inputBccIdentityFocusNode.dispose();
|
inputBccIdentityFocusNode.dispose();
|
||||||
inputNameIdentityController.dispose();
|
inputNameIdentityController.dispose();
|
||||||
@@ -382,7 +406,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
|
|||||||
} else {
|
} else {
|
||||||
bccOfIdentity.value = null;
|
bccOfIdentity.value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (identity?.email?.isNotEmpty == true) {
|
if (identity?.email?.isNotEmpty == true) {
|
||||||
emailOfIdentity.value = listEmailAddressDefault
|
emailOfIdentity.value = listEmailAddressDefault
|
||||||
.firstWhereOrNull((emailAddress) => emailAddress.email == identity!.email);
|
.firstWhereOrNull((emailAddress) => emailAddress.email == identity!.email);
|
||||||
@@ -467,7 +491,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
|
|||||||
if (actionType.value == IdentityActionType.create) {
|
if (actionType.value == IdentityActionType.create) {
|
||||||
final generateCreateId = Id(uuid.v1());
|
final generateCreateId = Id(uuid.v1());
|
||||||
final identityRequest = CreateNewIdentityRequest(
|
final identityRequest = CreateNewIdentityRequest(
|
||||||
generateCreateId,
|
generateCreateId,
|
||||||
identityAndPublicAssetArguments.identity,
|
identityAndPublicAssetArguments.identity,
|
||||||
publicAssetsInIdentityArguments: identityAndPublicAssetArguments.publicAssetsInIdentityArguments,
|
publicAssetsInIdentityArguments: identityAndPublicAssetArguments.publicAssetsInIdentityArguments,
|
||||||
isDefaultIdentity: isDefaultIdentity.value);
|
isDefaultIdentity: isDefaultIdentity.value);
|
||||||
@@ -921,7 +945,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> onUnloadBrowserListener(html.Event event) => _saveIdentityCacheOnWebAction();
|
Future<void> onUnloadBrowserListener(html.Event event) => _saveIdentityCacheOnWebAction();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> onBeforeReconnect() => _saveIdentityCacheOnWebAction();
|
Future<void> onBeforeReconnect() => _saveIdentityCacheOnWebAction();
|
||||||
|
|
||||||
@@ -934,7 +958,7 @@ class IdentityCreatorController extends BaseController with DragDropFileMixin im
|
|||||||
identityActionType: actionType.value,
|
identityActionType: actionType.value,
|
||||||
isDefault: isDefaultIdentity.value,
|
isDefault: isDefaultIdentity.value,
|
||||||
publicAssetsInIdentityArguments: cacheArguments.publicAssetsInIdentityArguments);
|
publicAssetsInIdentityArguments: cacheArguments.publicAssetsInIdentityArguments);
|
||||||
|
|
||||||
consumeState(_saveIdentityCacheOnWebInteractor.execute(
|
consumeState(_saveIdentityCacheOnWebInteractor.execute(
|
||||||
accountId!,
|
accountId!,
|
||||||
session!.username,
|
session!.username,
|
||||||
|
|||||||
Reference in New Issue
Block a user