Я пытаюсь получить ширину и высоту редактора tinymce.
Я пытаюсь установить ширину и высоту текстовой области с помощью текстового редактора.
пробовал с jquery, но по умолчанию возвращается только ширина = 100px: |
setup : function(ed) {
// Add a custom button
ed.addButton('bbcodemode', {
title : 'View BBcode source',
image : '{link}/tiny_mce/themes/advanced/img/bbcodemode.gif',
onclick : function() {
$.ajax({
type: "POST",
url: "{link}/htmltobbcode/",
data: "ctn="+encodeURIComponent(tinyMCE.activeEditor.getContent()),
success: function(msg){
$('#post_content').val(msg);
//tinyMCE.activeEditor.setContent(msg);
}
});
alert($('#post_content_ifr').width());
$('#post_content').css("width",$('#post_content_ifr').width());
$('#post_content').css("height",$('#post_content_ifr').height());
// Add you own code to execute something on click
tinyMCE.execCommand('mceToggleEditor',false,'post_content');
}
});
}