TF-2116 Insert image at mouse cursor position
(cherry picked from commit cb347e5077eddb1366daf706aa87eb2291f71aab)
This commit is contained in:
+11
-3
@@ -9,12 +9,20 @@ import 'package:tmail_ui_user/features/composer/presentation/model/inline_image.
|
||||
class RichTextMobileTabletController extends BaseRichTextController {
|
||||
HtmlEditorApi? htmlEditorApi;
|
||||
|
||||
void insertImage(InlineImage image, {double? maxWithEditor}) async {
|
||||
log('RichTextMobileTabletController::insertImage(): $image | maxWithEditor: $maxWithEditor');
|
||||
void insertImage(
|
||||
InlineImage image,
|
||||
{
|
||||
double? maxWithEditor,
|
||||
bool fromFileShare = false
|
||||
}
|
||||
) async {
|
||||
log('RichTextMobileTabletController::insertImage(): $image | maxWithEditor: $maxWithEditor | $fromFileShare');
|
||||
if (image.source == ImageSource.network) {
|
||||
htmlEditorApi?.insertImageLink(image.link!);
|
||||
} else {
|
||||
await htmlEditorApi?.moveCursorAtLastNode();
|
||||
if (fromFileShare) {
|
||||
await htmlEditorApi?.moveCursorAtLastNode();
|
||||
}
|
||||
await htmlEditorApi?.insertHtml(image.base64Uri ?? '');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user