Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[jsfm] add event support without binding to Element (#1709)
Browse files Browse the repository at this point in the history
  • Loading branch information
imyzf authored and Hanks10100 committed Nov 5, 2018
1 parent dd7a631 commit e6c3533
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion runtime/bridge/receiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e6c3533

Please sign in to comment.