TF-583 Disable zoom content in email view
This commit is contained in:
@@ -123,11 +123,31 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb> {
|
|||||||
</script>
|
</script>
|
||||||
''';
|
''';
|
||||||
|
|
||||||
|
final scriptsDisableZoom = '''
|
||||||
|
<script type="text/javascript">
|
||||||
|
document.addEventListener('wheel', function(e) {
|
||||||
|
e.ctrlKey && e.preventDefault();
|
||||||
|
}, {
|
||||||
|
passive: false,
|
||||||
|
});
|
||||||
|
window.addEventListener('keydown', function(e) {
|
||||||
|
if (event.metaKey || event.ctrlKey) {
|
||||||
|
switch (event.key) {
|
||||||
|
case '=':
|
||||||
|
case '-':
|
||||||
|
event.preventDefault();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
''';
|
||||||
|
|
||||||
final htmlTemplate = generateHtml(content,
|
final htmlTemplate = generateHtml(content,
|
||||||
minHeight: minHeight,
|
minHeight: minHeight,
|
||||||
minWidth: minWidth,
|
minWidth: minWidth,
|
||||||
styleCSS: tooltipLinkCss,
|
styleCSS: tooltipLinkCss,
|
||||||
javaScripts: webViewActionScripts);
|
javaScripts: webViewActionScripts + scriptsDisableZoom);
|
||||||
|
|
||||||
return htmlTemplate;
|
return htmlTemplate;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ class _HtmlContentViewState extends State<HtmlContentViewer> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
zoomEnabled: false,
|
||||||
navigationDelegate: _onNavigation,
|
navigationDelegate: _onNavigation,
|
||||||
gestureRecognizers: {
|
gestureRecognizers: {
|
||||||
Factory<LongPressGestureRecognizer>(() => LongPressGestureRecognizer()),
|
Factory<LongPressGestureRecognizer>(() => LongPressGestureRecognizer()),
|
||||||
|
|||||||
Reference in New Issue
Block a user