File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/BootstrapBlazor/Components/IFrame Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 11import Data from "../../modules/data.js"
22
3- export function init ( id , invoke , callback ) {
3+ export function init ( id , invoke , options ) {
4+ const { data, triggerPostDataCallback, triggerLoadedCallback } = options ;
45 const handler = e => {
5- invoke . invokeMethodAsync ( callback , e . data )
6+ invoke . invokeMethodAsync ( triggerPostDataCallback , e . data )
67 }
78 Data . set ( id , handler )
89
9- window . addEventListener ( 'message' , handler ) ;
1010 const frame = document . getElementById ( id ) ;
1111
1212 frame . onload = ( ) => {
13- invoke . invokeMethodAsync ( "TriggerLoaded" ) ;
13+ invoke . invokeMethodAsync ( triggerLoadedCallback ) ;
14+ window . addEventListener ( 'message' , handler ) ;
15+ if ( data ) {
16+ frame . contentWindow . postMessage ( data ) ;
17+ }
1418 }
1519}
1620
You can’t perform that action at this time.
0 commit comments