Files: 43af34efb145e2705ff168ae3e6f3cc6832314ac / bus.js
386 bytesRaw
1 | let bus |
2 | module.exports = bus = require('page-bus')('ssb-cms') |
3 | module.exports.sendToParentFrame = (eventName, data) => { |
4 | if (window.frameElement) { |
5 | const payload = Object.assign({}, data, { |
6 | screenId: +window.frameElement.id |
7 | }) |
8 | console.log(`sendToParentFrame: ${eventName}, ${JSON.stringify(payload)}`) |
9 | bus.emit(eventName, payload) |
10 | bus.emit('dummy', {}) |
11 | } |
12 | } |
13 |
Built with git-ssb-web