mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-29 08:09:58 +09:00
Fix too many simultaneous requests on agreement edit screen
약관 에디터 iframe을 동시에 5개 띄우면서 과부하가 발생하는 문제 수정
This commit is contained in:
parent
04fbcdd514
commit
e19c196a67
6 changed files with 65 additions and 23 deletions
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
(function($) {
|
||||
|
||||
// Editor replacement callback function
|
||||
var editor_replace = function(input) {
|
||||
var iframe = $('<iframe class="editor_iframe"></iframe>');
|
||||
iframe.attr("src", current_url.setQuery("act", "dispMemberAdminAgreementsEdit").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