mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
Move editor frame function to editorView::dispEditorFrame
This commit is contained in:
parent
488181eaae
commit
7d5b78b269
6 changed files with 35 additions and 36 deletions
32
modules/editor/tpl/editor_frame.html
Normal file
32
modules/editor/tpl/editor_frame.html
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<script>
|
||||
$(function() {
|
||||
var editor;
|
||||
var parent = window.opener ? window.opener : window.parent;
|
||||
var parent_input = $("#{$parent_input_id}", parent.document);
|
||||
var parent_iframe = parent_input.siblings("iframe.editor_iframe");
|
||||
CKEDITOR.on('instanceReady', function(evt) {
|
||||
editor = evt.editor;
|
||||
editor.setData(parent_input.val());
|
||||
editor.on("resize", function(evt){
|
||||
var height = evt.data.outerHeight;
|
||||
parent_iframe.height(height);
|
||||
});
|
||||
editor.on("change", function() {
|
||||
var content = editor.getData();
|
||||
parent_input.val(content);
|
||||
});
|
||||
parent_iframe.height($(".cke_chrome").parent().height());
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body { margin: 0; }
|
||||
.wfsr { display: none; }
|
||||
</style>
|
||||
|
||||
<form>
|
||||
<input type="hidden" name="primary_key" id="primary_key" value="" />
|
||||
<input type="hidden" name="content" id="content" value="" />
|
||||
{$editor}
|
||||
</form>
|
||||
Loading…
Add table
Add a link
Reference in a new issue