mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +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
|
|
@ -18,8 +18,8 @@
|
|||
<div class="x_control-group">
|
||||
<div class="x_control-label">{$lang->cmd_agreement_content}</div>
|
||||
<div class="x_controls">
|
||||
<input type="hidden" class="editor_content" name="agreement_{$i}_content" id="agreement_{$i}_content" value="{escape($config->agreements[$i]->content)}" />
|
||||
<div class="editor_preview xe_content" tabindex="0">{$config->agreements[$i]->content}</div>
|
||||
<input type="hidden" class="editable_preview_content" name="agreement_{$i}_content" id="agreement_{$i}_content" value="{escape($config->agreements[$i]->content)}" />
|
||||
<div class="editable_preview">{$config->agreements[$i]->content}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
.editor_preview {
|
||||
width: 100%;
|
||||
min-height: 240px;
|
||||
max-height: 440px;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 6px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
overflow-y: auto;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.editor_preview p {
|
||||
margin-bottom: @default_paragraph_spacing !important;
|
||||
}
|
||||
|
||||
.editor_iframe {
|
||||
width: 100%;
|
||||
height: 440px;
|
||||
box-sizing: border-box;
|
||||
margin: 0 0 -4px 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
<load target="css/config.less" />
|
||||
<load target="js/config.js" />
|
||||
<div class="x_page-header">
|
||||
<h1>{$lang->cmd_member_config} <a class="x_icon-question-sign" href="./common/manual/admin/index.html#UMAN_member_config" target="_blank">{$lang->help}</a></h1>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
|
||||
(function($) {
|
||||
|
||||
// Editor replacement callback function
|
||||
var editor_replace = function(input) {
|
||||
var iframe = $('<iframe class="editor_iframe"></iframe>');
|
||||
iframe.attr("src", current_url.setQuery("module", "editor").setQuery("act", "dispEditorFrame").setQuery("parent_input_id", input.attr("id")));
|
||||
iframe.insertAfter(input);
|
||||
input.siblings(".editor_preview").hide();
|
||||
if (input.attr("type") !== "hidden") {
|
||||
input.hide();
|
||||
}
|
||||
};
|
||||
|
||||
// Editor replacement
|
||||
$(function() {
|
||||
$(".editor_preview").on("click", function() {
|
||||
var input = $(this).siblings(".editor_content");
|
||||
if (input.size()) {
|
||||
$(this).off("click").off("focus");
|
||||
editor_replace(input.first());
|
||||
}
|
||||
});
|
||||
$(".editor_preview").on("focus", function() {
|
||||
$(this).triggerHandler("click");
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
Loading…
Add table
Add a link
Reference in a new issue