#5997 closed Bug (invalid)
The resize only works the first time.
| Reported by: | DiegoC | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | General | Version: | 3.3.1 |
| Keywords: | Cc: | dcuadra@… |
Description
Hi, I'm using for example
EditorTxt = CKEDITOR.appendTo(Contenedor, config, html);
EditorTxt.config.resize_enabled = false;
the first time I show the editor, it works perfectly, but if I destroy() it and created again, the resize_enabled dosen't work. But if I use
EditorTxt = CKEDITOR.appendTo(Contenedor, config, html);
CKEDITOR.config.resize_enabled = false;
it works perfectly. The problem is that I'm using also this:
CKEDITOR.on('instanceReady', function (e) { CuadroDeTexto_Ajusta() });
function CuadroDeTexto_Ajusta() {
var x = CKEDITOR.document.getById('cke_contents_' + EditorTxt.name);
if (x != null) {
var textEditor = ContenedorCuadroTexto.children().eq(0);
CKEDITOR.config.height = textEditor.height() - 10;
EditorTxt.resize(textEditor.width() - 12, CKEDITOR.config.height);
}
}
And I don't know how to make this works because the first time it work but the second one, the EditorTxt.resize doesn't work. Thanks Diego
Change History (6)
comment:1 Changed 15 years ago by
| Cc: | dcuadra@… added |
|---|
comment:2 Changed 15 years ago by
| Keywords: | config resize removed |
|---|---|
| Resolution: | → invalid |
| Status: | new → closed |
comment:3 Changed 15 years ago by
Sorry, but I think you didn't undestand what I mean. I know that in the first snippet I was using editor-specific configuration and in the other I was using global configuration. The problem is that with the editor-specific configuration, if you destroy the editor and then put again the editor-specific configuration, it does not take this configuration. You can see the problem in this example.
<head>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
</head>
<body>
<p>
<input onclick="createEditor();" type="button" value="Create Editor" />
</p>
<div id="txt"></div>
<script type="text/javascript">
//<![CDATA[
var editor;
function createEditor() {
if (editor) {
editor.destroy();
editor = null;
}
var html = "test";
var config = {};
editor = CKEDITOR.appendTo('txt', config, html);
editor.config.resize_enabled = false;
}
//]]>
</script>
</body>
</html>
you can see that the second time you press the button, the resize_enabled get's true. Sorry if I do not express correctly the problem.
comment:4 Changed 15 years ago by
Ok, the problem is that you're setting the configuration *after* the editor is created, which is wrong. The correct way for your approach would be:
var html = "test";
var config = { resize_enabled : false };
editor = CKEDITOR.appendTo('txt', config, html);
comment:5 Changed 15 years ago by
I test that way, and it is correct, but my basic problem, form the begining is how to
resize
the editor if I have to wait until instanceReady.
comment:6 Changed 15 years ago by
Ok, so if it's not a bug, please use our forums for generic discussions and community support.

In the first snippet you're using editor-specific configuration. After you destory that editor the configuration is also removed, therefore you need to set it again when recreating. In the second snippet you're using a global configuration which is never removed and applies to all editors in the page.
We also recommend using the
editor.resize( width, height )function.Please feel free to reopen the ticket if I misunderstood your problem.