mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 08:12:17 +09:00
Apply editor replacement to all .editable_preview elements
This commit is contained in:
parent
1728d17867
commit
a0ae7a2a30
9 changed files with 63 additions and 75 deletions
|
|
@ -22,6 +22,7 @@ class editorView extends editor
|
|||
{
|
||||
// Check parent input ID
|
||||
$parent_input_id = Context::get('parent_input_id');
|
||||
Context::set('parent_input_id', preg_replace('/[^a-z0-9_]/i', '', $parent_input_id));
|
||||
Context::addBodyClass('disable_debug_panel');
|
||||
|
||||
// Load editor
|
||||
|
|
|
|||
|
|
@ -1,22 +1,8 @@
|
|||
<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());
|
||||
});
|
||||
window.editor_copy_input = $("#{$parent_input_id}", parent.document);
|
||||
window.editor_resize_iframe = window.editor_copy_input.siblings("iframe.editor_iframe");
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -145,6 +145,19 @@ function getAutoSavedSrl(ret_obj, response_tags, c) {
|
|||
|
||||
instance.on('instanceReady', function(e) {
|
||||
$containerEl.css("min-height", 0);
|
||||
if(window.editor_resize_iframe && window.editor_copy_input)
|
||||
{
|
||||
e.editor.setData(editor_copy_input.val());
|
||||
e.editor.on("resize", function(e){
|
||||
var height = e.data.outerHeight;
|
||||
editor_resize_iframe.height(height);
|
||||
});
|
||||
e.editor.on("change", function() {
|
||||
var content = e.editor.getData();
|
||||
editor_copy_input.val(content);
|
||||
});
|
||||
editor_resize_iframe.height($(".cke_chrome").parent().height());
|
||||
}
|
||||
});
|
||||
|
||||
instance.on('paste', function(e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue