mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Consolidate popup/iframe handling code in common areas
This commit is contained in:
parent
262560ce04
commit
7157181726
6 changed files with 51 additions and 41 deletions
|
|
@ -1,5 +1,3 @@
|
|||
<include target="popup_iframe.blade.php" />
|
||||
|
||||
<script>
|
||||
alert("{$message}");
|
||||
window.close();
|
||||
|
|
|
|||
|
|
@ -211,26 +211,12 @@ function openComponent(component_name, editor_sequence, manual_url) {
|
|||
if(typeof(current_mid)!="undefined" && current_mid) popup_url += "&mid="+escape(current_mid);
|
||||
|
||||
if (navigator.userAgent.match(/mobile/i)) {
|
||||
openComponentInIframe(popup_url);
|
||||
openFullScreenIframe(popup_url, 'editorComponent');
|
||||
} else {
|
||||
popopen(popup_url, 'editorComponent');
|
||||
}
|
||||
}
|
||||
|
||||
function openComponentInIframe(popup_url) {
|
||||
var iframe_sequence = String(Date.now()) + Math.round(Math.random() * 1000000);
|
||||
var iframe = document.createElement('iframe');
|
||||
popup_url += '&iframe_sequence=' + iframe_sequence;
|
||||
iframe.setAttribute('id', 'editor_iframe_' + iframe_sequence);
|
||||
iframe.setAttribute('src', popup_url);
|
||||
iframe.setAttribute('width', '100%');
|
||||
iframe.setAttribute('height', '100%');
|
||||
iframe.setAttribute('frameborder', '0');
|
||||
iframe.setAttribute('scrolling', 'no');
|
||||
iframe.setAttribute('style', 'position:fixed; top:0; left:0; width:100%; height:100%; z-index:999999999; background-color: #fff; overflow-y:auto');
|
||||
$(document.body).append(iframe);
|
||||
}
|
||||
|
||||
// 더블클릭 이벤트 발생시에 본문내에 포함된 컴포넌트를 찾는 함수
|
||||
var editorPrevNode = null;
|
||||
function editorSearchComponent(evt) {
|
||||
|
|
@ -256,7 +242,12 @@ function editorSearchComponent(evt) {
|
|||
editorPrevNode = obj;
|
||||
|
||||
if(editorMode[editor_sequence]=='html') return;
|
||||
popopen(request_uri+"?module=widget&act=dispWidgetGenerateCodeInPage&selected_widget="+widget+"&module_srl="+editor_sequence,'GenerateCodeInPage');
|
||||
var popup_url = request_uri+"?module=widget&act=dispWidgetGenerateCodeInPage&selected_widget="+widget+"&module_srl="+editor_sequence
|
||||
if (navigator.userAgent.match(/mobile/i)) {
|
||||
openFullScreenIframe(popup_url, 'GenerateCodeInPage');
|
||||
} else {
|
||||
popopen(popup_url, 'GenerateCodeInPage');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
<include target="popup_iframe.blade.php" />
|
||||
|
||||
<div>
|
||||
{$popup_content|noescape}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
@if (isset($iframe_sequence) && !empty($iframe_sequence))
|
||||
<script>
|
||||
const iframe_sequence = '{{ $iframe_sequence }}';
|
||||
window.opener = window.parent;
|
||||
window.close = function() {
|
||||
parent.document.getElementById('editor_iframe_' + iframe_sequence).remove();
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.x.popup { width: 100vw; height: 100vh; }
|
||||
.x.popup > div { width: 100vw; height: 100vh; display: flex; flex-direction: column; }
|
||||
.x_modal-header { flex: 0 0 auto; }
|
||||
.x_modal-body { flex: 1; overflow: scroll; }
|
||||
</style>
|
||||
@endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue