diff --git a/app/assets/javascripts/lib/items/items.js.erb b/app/assets/javascripts/lib/items/items.js.erb index 8296503e4..8fe1a55af 100644 --- a/app/assets/javascripts/lib/items/items.js.erb +++ b/app/assets/javascripts/lib/items/items.js.erb @@ -111,10 +111,27 @@ function customOpenSlide() { .closest('.navbar-inner') .addClass('active'); pageslide.find('.content').css('padding', 0); + iFrameContent() } }); } - +function iFrameContent() { + $('#pageslide_iframe').load(function() { + var $iContents = $(this).contents(), + $pc = $iContents.find('.page_content'); + $pc.each(function(index, el) { + if($(this).siblings('*').length == 0) { + var _parentH = $(this).parent('*').outerHeight(); + $(this).css('height', _parentH); + } + }); + $iContents.find('#orbit-bar').hide(); + $iContents.find('.main_wrap').css('margin-top', 0); + $iContents.find('a').not('.edit_link a').on('click', function(event) { + event.preventDefault(); + }); + }); +} function pageSetting(id, edit) { $pageModule = $('#pageslide #page_module_app_id'); $pageF2E = $('#pageslide #page_app_frontend_url'); @@ -149,7 +166,6 @@ function pageSetting(id, edit) { }); }; }); - $pageModule.append(''); if(_selectData.module.main && val.main[1] == _selectData.module.main) { @@ -193,7 +209,7 @@ function pageSetting(id, edit) { $('#pageslide .active-link.' + val[0]).find('input[type="radio"]').eq(val[2]).prop('checked', true); } }); - changeSetting(id); + changeSetting(id, _status); $('#pageslide').find('.nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true }); }) .fail(function(jqXHR, textStatus) { @@ -211,11 +227,10 @@ function pageSetting(id, edit) { }); }; }); - $pageModule.append(''); }); - changeSetting(id); + changeSetting(id, _status); }; }; @@ -250,8 +265,8 @@ function linkSetting(id, edit) { } } -function changeSetting(id) { - getView(id); +function changeSetting(id, edit) { + edit ? getView(id) : ''; $pagePublishedTrue.prop('checked') ? $('.link-options').slideDown(300) : $('.link-options').slideUp(300); } @@ -368,7 +383,7 @@ $(function() { $subSelete.append(''); }); $.each(val.count, function(index, val) { - $pageCount.append(''); + $pageCount.append(''); }); $pageDivCount.show(); diff --git a/app/assets/javascripts/lib/pageslide.js b/app/assets/javascripts/lib/pageslide.js index ec5022504..610259ac9 100644 --- a/app/assets/javascripts/lib/pageslide.js +++ b/app/assets/javascripts/lib/pageslide.js @@ -54,7 +54,7 @@ // Load a URL. Into an iframe? if(settings.iframe) { window.console.log("iFrame"); - var iframe = $("