mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
Enable textarea to be used as member agreement editor
This commit is contained in:
parent
499a7e4457
commit
c4f3110291
3 changed files with 19 additions and 4 deletions
|
|
@ -4,6 +4,7 @@ function editorTextarea(editor_sequence) {
|
|||
var primary_key = textarea.data("editor-primary-key-name");
|
||||
var insert_form = textarea.closest("form");
|
||||
var content_input = insert_form.find("input[name='" + content_key + "']");
|
||||
var content = "";
|
||||
|
||||
// Set editor keys
|
||||
editorRelKeys[editor_sequence] = {};
|
||||
|
|
@ -16,7 +17,7 @@ function editorTextarea(editor_sequence) {
|
|||
|
||||
// Load existing content
|
||||
if (content_input.size()) {
|
||||
var content = String(content_input.val()).stripTags();
|
||||
content = String(content_input.val()).stripTags();
|
||||
content_input.val(content);
|
||||
textarea.val(content.unescape());
|
||||
}
|
||||
|
|
@ -25,4 +26,19 @@ function editorTextarea(editor_sequence) {
|
|||
textarea.on("change", function() {
|
||||
content_input.val(String(jQuery(this).val()).escape());
|
||||
});
|
||||
|
||||
// Copy content to another input and resize iframe if configured
|
||||
if (window.editor_resize_iframe && window.editor_copy_input)
|
||||
{
|
||||
content = String(editor_copy_input.val()).stripTags();
|
||||
editor_copy_input.val(content);
|
||||
textarea.val(content.unescape());
|
||||
textarea.on("resize", function(e){
|
||||
editor_resize_iframe.height(textarea.height());
|
||||
});
|
||||
textarea.on("change", function() {
|
||||
editor_copy_input.val(String(textarea.val()).escape());
|
||||
});
|
||||
editor_resize_iframe.height(textarea.height());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue