summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/contact-form/js/grunion.js')
-rw-r--r--plugins/jetpack/modules/contact-form/js/grunion.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/jetpack/modules/contact-form/js/grunion.js b/plugins/jetpack/modules/contact-form/js/grunion.js
index 040710bf..4fe391bf 100644
--- a/plugins/jetpack/modules/contact-form/js/grunion.js
+++ b/plugins/jetpack/modules/contact-form/js/grunion.js
@@ -387,12 +387,16 @@ FB.ContactForm = function() {
jQuery( '#content', window.parent.document ).val( currentCode.replace( regexp, response ) );
}
} else {
- if (isVisual) {
- win.tinyMCE.activeEditor.execCommand('mceInsertContent', false, response);
- } else {
- // looks like the visual editor is disabled,
- // update the contents of the post directly
- jQuery( '#content', window.parent.document ).val( currentCode + response );
+ try {
+ win.send_to_editor( response );
+ } catch ( e ) {
+ if (isVisual) {
+ win.tinyMCE.activeEditor.execCommand('mceInsertContent', false, response);
+ } else {
+ // looks like the visual editor is disabled,
+ // update the contents of the post directly
+ jQuery( '#content', window.parent.document ).val( currentCode + response );
+ }
}
}
hidePopup();