TF-4152 Fix tooltip stay out of screen in Email View
This commit is contained in:
@@ -419,4 +419,39 @@ class HtmlInteraction {
|
||||
});
|
||||
</script>
|
||||
''';
|
||||
|
||||
static String scriptsHandleIframeLinkHoverListener(String viewId) => '''
|
||||
<script type="text/javascript">
|
||||
document.addEventListener("mouseover", function (e) {
|
||||
const target = e.target;
|
||||
if (target.tagName.toLowerCase() === "a") {
|
||||
const rect = target.getBoundingClientRect();
|
||||
|
||||
const payload = {
|
||||
view: '$viewId',
|
||||
type: 'toDart: iframeLinkHover',
|
||||
url: target.href,
|
||||
rect: {
|
||||
x: rect.x,
|
||||
y: rect.y,
|
||||
width: rect.width,
|
||||
height: rect.height
|
||||
}
|
||||
};
|
||||
window.parent.postMessage(JSON.stringify(payload), "*");
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener("mouseout", function (e) {
|
||||
const target = e.target;
|
||||
if (target.tagName.toLowerCase() === "a") {
|
||||
const payload = {
|
||||
view: '$viewId',
|
||||
type: 'toDart: iframeLinkOut'
|
||||
};
|
||||
window.parent.postMessage(JSON.stringify(payload), "*");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
''';
|
||||
}
|
||||
@@ -2,27 +2,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class HtmlTemplate {
|
||||
static const String nameClassToolTip = 'tmail-tooltip';
|
||||
static const String tooltipLinkCss = '''
|
||||
.$nameClassToolTip .tooltiptext {
|
||||
visibility: hidden;
|
||||
max-width: 400px;
|
||||
background-color: black;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
padding: 5px 8px 5px 8px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
.$nameClassToolTip:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
}
|
||||
''';
|
||||
|
||||
static const String printDocumentCssStyle = '''
|
||||
<style>
|
||||
$fontFaceStyle
|
||||
|
||||
Reference in New Issue
Block a user