mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-03 03:58:13 +08:00
Modifying TinyMCE 'addmedia' plugin to account for modal dialogs.
--HG-- branch : dev
This commit is contained in:
@@ -27,7 +27,12 @@ var AddMediaDialog = {
|
||||
var result = window.frames[iframeName].result, close = 0;
|
||||
|
||||
if (result && result.url) {
|
||||
window.parent.AddMediaDialog.insertMedia(result.url);
|
||||
if (window.parent && window.parent.AddMediaDialog) {
|
||||
window.parent.AddMediaDialog.insertMedia(result.url);
|
||||
} else {
|
||||
AddMediaDialog.insertMedia(result.url);
|
||||
}
|
||||
|
||||
close = 1;
|
||||
} else if (result && result.error) {
|
||||
alert(tinyMCEPopup.getLang("addmedia_dlg.msg_error") + "\n\r\n\r" + result.error);
|
||||
@@ -48,7 +53,14 @@ var AddMediaDialog = {
|
||||
tinymce.dom.Event.remove(iframe, 'load', iframeLoadHandler);
|
||||
tinymce.DOM.remove(iframe);
|
||||
iframe = null;
|
||||
if (close) window.parent.tinyMCEPopup.close();
|
||||
|
||||
if (close) {
|
||||
if (window.parent && window.parent.tinyMCEPopup) {
|
||||
window.parent.tinyMCEPopup.close();
|
||||
} else {
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
}
|
||||
},
|
||||
123);
|
||||
} catch (ex) {
|
||||
|
||||
Reference in New Issue
Block a user