mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-27 02:23:28 +08:00
fix(email-frame): Allow events to bubble correctly and pass iframe
This commit is contained in:
parent
4a738602ab
commit
cf0ad099e1
3 changed files with 9 additions and 0 deletions
|
@ -78,6 +78,7 @@ export default class EmailFrame extends React.Component {
|
|||
extension.renderedMessageBodyIntoDocument({
|
||||
document: doc,
|
||||
message: this.props.message,
|
||||
iframe: iframeNode,
|
||||
});
|
||||
} catch (e) {
|
||||
NylasEnv.reportError(e);
|
||||
|
|
|
@ -189,6 +189,7 @@ class EventedIFrame extends React.Component
|
|||
eventAttrs[key] = event[key]
|
||||
|
||||
node.dispatchEvent(new MouseEvent(event.type, _.extend({}, eventAttrs, {
|
||||
bubbles: true
|
||||
clientX: event.clientX + nodeRect.left
|
||||
clientY: event.clientY + nodeRect.top
|
||||
pageX: event.pageX + nodeRect.left
|
||||
|
|
|
@ -30,4 +30,11 @@ class MessageViewExtension
|
|||
###
|
||||
@formatMessageBody: ({message}) ->
|
||||
|
||||
###
|
||||
Public: Modify the rendered message body using the DOM.
|
||||
Runs after messages goes through `formatMessageBody` and is placed
|
||||
into the DOM.
|
||||
###
|
||||
@renderedMessageBodyIntoDocument: ({document, message, iframe}) ->
|
||||
|
||||
module.exports = MessageViewExtension
|
||||
|
|
Loading…
Reference in a new issue