mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-02-01 09:39:58 +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
|
|
@ -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