You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2018/11/05 13:24:17 UTC

[GitHub] Hanks10100 closed pull request #1709: [jsfm] add event support without binding to Element

Hanks10100 closed pull request #1709: [jsfm] add event support without binding to Element
URL: https://github.com/apache/incubator-weex/pull/1709
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/runtime/bridge/receiver.js b/runtime/bridge/receiver.js
index ecf6fa1a64..d12bb08d77 100644
--- a/runtime/bridge/receiver.js
+++ b/runtime/bridge/receiver.js
@@ -23,8 +23,11 @@ function fireEvent (document, nodeId, type, event, domChanges, params) {
   const el = document.getRef(nodeId)
   if (el) {
     return document.fireEvent(el, type, event, domChanges, params)
+  } else {
+    event._nodeId = nodeId
+    return document.fireEvent(document.getRef('_documentElement'), type, event, domChanges, params)
   }
-  return new Error(`invalid element reference "${nodeId}"`)
+
 }
 
 function callback (document, callbackId, data, ifKeepAlive) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services