Item control iframe dom

Css for preview
This commit is contained in:
chris committed 2013-10-26 18:58:53 +08:00
1 parent 13da6fc6a1
commit f3b3c94b42
13 files changed
+105 -124

No files matched your search

+23 -8
View File
@@ -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('<option/>');
$.each(_pageData.module, function(index, val) {
$pageModule.append('<option value="' + val.main[1] + '" ' + (val.main[1] == _selectData.module.main ? 'selected="selected"' : '') + '>' + val.main[0] + '</option>');
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('<option/>');
$.each(_pageData.module, function(index, val) {
$pageModule.append('<option value="' + val.main[1] + '">' + val.main[0] + '</option>');
});
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('<option value="' + $(this)[1] + '" ' + _selected + '>' + $(this)[0] + '</option>');
});
$.each(val.count, function(index, val) {
$pageCount.append('<option value="' + val + '" ' + (_select.main == _val && val == _selectData.module.count ? 'selected="selected"' : '') + '>' + val+ '</option>');
$pageCount.append('<option value="' + val + '" ' + (_select && _select.main == _val && val == _selectData.module.count ? 'selected="selected"' : '') + '>' + val+ '</option>');
});
$pageDivCount.show();
+2 -2
View File
@@ -54,7 +54,7 @@
// Load a URL. Into an iframe?
if(settings.iframe) {
window.console.log("iFrame");
var iframe = $("<iframe />").attr({
var iframe = $('<iframe id="pageslide_iframe" />').attr({
src: settings.href,
frameborder: 0,
hspace: 0
@@ -63,7 +63,7 @@
width: "100%",
height: "100%"
});
$pageslide.find('.content').html(iframe).show();
$pageslide.find('.content').css('overflow', 'hidden').html(iframe).show();
if(settings.loadComplete)settings.loadComplete.call(this, $pageslide, $element);
} else {
window.console.log("Load");