...
General: Make sure to use tinymce 4's windowManager in order to display model dialogs. Pass custom parameters like in their example to the new window. Their documentation mentions the setParams function to write into the variables you passed to the dialog during opening. Close the dialog window using the tinymce instance in the calling window, e.g. using "parent.tinymce.activeEditor.windowManager.close(window)". Bind the dialog instance you created using the open function of the windowManager using the on function of the instance to the close event.
Code Block | ||||
---|---|---|---|---|
| ||||
// open dialog var diag = ed.windowManager.open({ title: 'Your window title', url: 'url/to/load', }, { oneCustomParameter: false }); // handle close event of dialog diag.on('close', function() { var args = ed.windowManager.getParams(); // your code here }); |