Skip to content

Commit

Permalink
Fixed #100
Browse files Browse the repository at this point in the history
  • Loading branch information
etcook committed Aug 29, 2014
1 parent b085020 commit 35b81bf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
15 changes: 9 additions & 6 deletions admin/assets/js/generator.js
Expand Up @@ -26,9 +26,11 @@ jQuery(document).ready(function($) {
}

var destroyModal = function(){
var editing = tinyMCE.activeEditor.dom.select('#aesop-generator-editing');
if(editing != ''){
editing[0].removeAttribute('id');
if ( tinyMCE.activeEditor ) {
var editing = tinyMCE.activeEditor.dom.select('#aesop-generator-editing');
if(editing != ''){
editing[0].removeAttribute('id');
}
}
$(modal).removeClass('aesop-generator-open');
$('body').removeClass('modal-open');
Expand Down Expand Up @@ -166,10 +168,11 @@ jQuery(document).ready(function($) {
$('#aesop-generator-result').val($('#aesop-generator-result').val() + $('#aesop-generator-content').val() + '[/' + aesop_compatibility_mode_prefix + queried_shortcode + ']');
}

var editing = tinyMCE.activeEditor.dom.select('#aesop-generator-editing');
tinyMCE.activeEditor.dom.remove(editing);
if ( tinyMCE.activeEditor ) {
var editing = tinyMCE.activeEditor.dom.select('#aesop-generator-editing');
tinyMCE.activeEditor.dom.remove(editing);
}

console.log(jQuery('#aesop-generator-result').val());
window.send_to_editor(jQuery('#aesop-generator-result').val());

// start new
Expand Down

0 comments on commit 35b81bf

Please sign in to comment.