fix(email-frame): Allow events to bubble correctly and pass iframe

This commit is contained in:
Jackie Luo 2016-05-27 15:18:12 -07:00
parent 4a738602ab
commit cf0ad099e1
3 changed files with 9 additions and 0 deletions

View file

@ -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);

View file

@ -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

View file

@ -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