只读时,tinymce用铬自动化 [英] tinymce autoresize with chrome when readonly

查看:332
本文介绍了只读时,tinymce用铬自动化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我试了一整天,但我没理解。

Hi guys i tried the full day, but i did not get it.

我使用tinymce编辑器,在所有浏览器中它都可以正常工作,除了 * * chrome。我在readonly模式下使用autoresize,我总是遇到问题,在chrome中,编辑器iframe是~20px到小,所以通常文本丢失。

I use the tinymce editor and in all browsers it works fine, except in ** chrome. I use the autoresize in readonly mode and i always have the problem that in chrome the editor iframe is ~20px to small, so that often text is missing.

我不是jquery或javascript破解并没有找到解决方案。
有一行设置样式 h.setStyle(h.get(a.id +_ ifr),height,k +px); 但是当我添加+20时,我遇到的问题是在编辑器模式下它总是在keydown时增加20 px。所以不是解决方案。

I am not the jquery or javascript crack and did not find a solution for it. There is a row where it is setting the style h.setStyle(h.get(a.id + "_ifr"), "height", k + "px"); but when i would add +20 i have the problem that in editor mode it always adds 20 px when keydown. So not a solution.

用css添加一些像素?但是我如何访问iframe元素?
也许你有人知道我能在这里做些什么来增加额外的像素。

Add some pixeld by css? But how do i access the iframe element? Maybe someone of you have an idea what i can do here to add there extra pixels.

编辑

好吧似乎没有人有兴趣帮忙,所以我做了一个解决方法。在插件文件中,我执行以下操作,也许它可以帮助人们,遇到同样的问题:

Ok seems no one has interest to help so i do it with a workaround. In the plugin file i do the following, maybe it helps people, having the same problem:

if (tinymce.isWebKit && tinymce.activeEditor.settings.readonly == true) {

然后你可以添加一些额外的像素,在我的情况下20px。也许有更好的解决方案,但它确实有效。

Then you can add some extra pixels, in my case 20px. Maybe there are much better solutions, but it works.

推荐答案

我有一个类似Chrome的问题,tinyMCE 3.5.6和自动调整插件。帮助手动调用 init_instance_callback 。我正在加载窗口时调用tinyMCE(jQuery版本):

I had a similiar problem with Chrome, tinyMCE 3.5.6 and the autoresize plugin. What helped was manually calling the resize plugin in the init_instance_callback. I'm calling tinyMCE (jQuery version) like this now when the window is loaded:

$('.tinymce').tinymce({
  theme : 'advanced',
  plugins : 'autoresize',
  width: '100%',
  height: 400,
  autoresize_min_height: 400,
  autoresize_max_height: 800,
  init_instance_callback: function (inst) { inst.execCommand('mceAutoResize'); }
});

这篇关于只读时,tinymce用铬自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆