TF-3264 Fix composer drag drop all modes (#3279)
This commit is contained in:
@@ -237,6 +237,7 @@ class ComposerController extends BaseController
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
if (PlatformInfo.isWeb) {
|
||||
responsiveContainerKey = GlobalKey();
|
||||
richTextWebController = getBinding<RichTextWebController>();
|
||||
responsiveContainerKey = GlobalKey();
|
||||
menuMoreOptionController = CustomPopupMenuController();
|
||||
@@ -286,6 +287,7 @@ class ComposerController extends BaseController
|
||||
richTextMobileTabletController = null;
|
||||
}
|
||||
_identityContentOnOpenPolicy = SignatureStatus.editedAvailable;
|
||||
responsiveContainerKey = null;
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
@@ -2246,6 +2248,12 @@ class ComposerController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
void handleOnDragOverHtmlEditorWeb(List<dynamic>? types) {
|
||||
if (types.validateFilesTransfer) {
|
||||
mailboxDashBoardController.localFileDraggableAppState.value = DraggableAppState.active;
|
||||
}
|
||||
}
|
||||
|
||||
void onLocalFileDropZoneListener({
|
||||
required BuildContext context,
|
||||
required DropDoneDetails details,
|
||||
|
||||
@@ -198,6 +198,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
||||
onEditorTextSizeChanged: controller.richTextWebController!.onEditorTextSizeChanged,
|
||||
height: constraints.maxHeight,
|
||||
onDragEnter: controller.handleOnDragEnterHtmlEditorWeb,
|
||||
onDragOver: controller.handleOnDragOverHtmlEditorWeb,
|
||||
onPasteImageSuccessAction: (listFileUpload) => controller.handleOnPasteImageSuccessAction(
|
||||
context: context,
|
||||
maxWidth: constraintsEditor.maxWidth,
|
||||
@@ -460,6 +461,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
||||
onEditorTextSizeChanged: controller.richTextWebController?.onEditorTextSizeChanged,
|
||||
height: constraints.maxHeight,
|
||||
onDragEnter: controller.handleOnDragEnterHtmlEditorWeb,
|
||||
onDragOver: controller.handleOnDragOverHtmlEditorWeb,
|
||||
onPasteImageSuccessAction: (listFileUpload) => controller.handleOnPasteImageSuccessAction(
|
||||
context: context,
|
||||
maxWidth: constraintsEditor.maxWidth,
|
||||
@@ -744,6 +746,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
||||
onEditorTextSizeChanged: controller.richTextWebController!.onEditorTextSizeChanged,
|
||||
height: constraints.maxHeight,
|
||||
onDragEnter: controller.handleOnDragEnterHtmlEditorWeb,
|
||||
onDragOver: controller.handleOnDragOverHtmlEditorWeb,
|
||||
onPasteImageSuccessAction: (listFileUpload) => controller.handleOnPasteImageSuccessAction(
|
||||
context: context,
|
||||
maxWidth: constraintsBody.maxWidth,
|
||||
|
||||
@@ -31,6 +31,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
||||
final OnEditorTextSizeChanged? onEditorTextSizeChanged;
|
||||
final double? height;
|
||||
final OnDragEnterListener? onDragEnter;
|
||||
final OnDragOverListener? onDragOver;
|
||||
final OnPasteImageSuccessAction? onPasteImageSuccessAction;
|
||||
final OnPasteImageFailureAction? onPasteImageFailureAction;
|
||||
final OnInitialContentLoadComplete? onInitialContentLoadComplete;
|
||||
@@ -50,6 +51,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
||||
this.onEditorTextSizeChanged,
|
||||
this.height,
|
||||
this.onDragEnter,
|
||||
this.onDragOver,
|
||||
this.onPasteImageSuccessAction,
|
||||
this.onPasteImageFailureAction,
|
||||
this.onInitialContentLoadComplete,
|
||||
@@ -78,6 +80,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
||||
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
||||
height: height,
|
||||
onDragEnter: onDragEnter,
|
||||
onDragOver: onDragOver,
|
||||
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
||||
onPasteImageFailureAction: onPasteImageFailureAction,
|
||||
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
||||
@@ -106,6 +109,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
||||
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
||||
height: height,
|
||||
onDragEnter: onDragEnter,
|
||||
onDragOver: onDragOver,
|
||||
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
||||
onPasteImageFailureAction: onPasteImageFailureAction,
|
||||
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
||||
@@ -133,6 +137,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
||||
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
||||
height: height,
|
||||
onDragEnter: onDragEnter,
|
||||
onDragOver: onDragOver,
|
||||
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
||||
onPasteImageFailureAction: onPasteImageFailureAction,
|
||||
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
||||
@@ -169,6 +174,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
||||
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
||||
height: height,
|
||||
onDragEnter: onDragEnter,
|
||||
onDragOver: onDragOver,
|
||||
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
||||
onPasteImageFailureAction: onPasteImageFailureAction,
|
||||
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
||||
@@ -200,6 +206,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
||||
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
||||
height: height,
|
||||
onDragEnter: onDragEnter,
|
||||
onDragOver: onDragOver,
|
||||
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
||||
onPasteImageFailureAction: onPasteImageFailureAction,
|
||||
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
||||
@@ -221,6 +228,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
||||
onEditorTextSizeChanged: onEditorTextSizeChanged,
|
||||
height: height,
|
||||
onDragEnter: onDragEnter,
|
||||
onDragOver: onDragOver,
|
||||
onPasteImageSuccessAction: onPasteImageSuccessAction,
|
||||
onPasteImageFailureAction: onPasteImageFailureAction,
|
||||
onInitialContentLoadComplete: onInitialContentLoadComplete,
|
||||
|
||||
@@ -13,6 +13,7 @@ typedef OnMouseDownEditorAction = Function();
|
||||
typedef OnEditorSettingsChange = Function(EditorSettings settings);
|
||||
typedef OnEditorTextSizeChanged = Function(int? size);
|
||||
typedef OnDragEnterListener = Function(List<dynamic>? types);
|
||||
typedef OnDragOverListener = Function(List<dynamic>? types);
|
||||
typedef OnPasteImageSuccessAction = Function(List<FileUpload> listFileUpload);
|
||||
typedef OnPasteImageFailureAction = Function(
|
||||
List<FileUpload>? listFileUpload,
|
||||
@@ -34,6 +35,7 @@ class WebEditorWidget extends StatefulWidget {
|
||||
final OnEditorTextSizeChanged? onEditorTextSizeChanged;
|
||||
final double? height;
|
||||
final OnDragEnterListener? onDragEnter;
|
||||
final OnDragOverListener? onDragOver;
|
||||
final OnPasteImageSuccessAction? onPasteImageSuccessAction;
|
||||
final OnPasteImageFailureAction? onPasteImageFailureAction;
|
||||
final OnInitialContentLoadComplete? onInitialContentLoadComplete;
|
||||
@@ -52,6 +54,7 @@ class WebEditorWidget extends StatefulWidget {
|
||||
this.onEditorTextSizeChanged,
|
||||
this.height,
|
||||
this.onDragEnter,
|
||||
this.onDragOver,
|
||||
this.onPasteImageSuccessAction,
|
||||
this.onPasteImageFailureAction,
|
||||
this.onInitialContentLoadComplete,
|
||||
@@ -160,6 +163,7 @@ class _WebEditorState extends State<WebEditorWidget> {
|
||||
HtmlUtils.lineHeight100Percent.name
|
||||
),
|
||||
onDragEnter: widget.onDragEnter,
|
||||
onDragOver: widget.onDragOver,
|
||||
onDragLeave: (_) {},
|
||||
onImageUpload: widget.onPasteImageSuccessAction,
|
||||
onImageUploadError: widget.onPasteImageFailureAction,
|
||||
|
||||
Reference in New Issue
Block a user