iFrame ajaxStop

This commit is contained in:
chris 2013-10-29 11:09:20 +08:00
parent 16659d79cd
commit 454e36b4ae
3 changed files with 18 additions and 16 deletions

View File

@ -116,20 +116,23 @@ function customOpenSlide() {
}); });
} }
function iFrameContent() { function iFrameContent() {
$('#pageslide_iframe').load(function() { function iFrameFunction(iContents, pc) {
var $iContents = $(this).contents(), pc.each(function(index, el) {
$pc = $iContents.find('.page_content');
$pc.each(function(index, el) {
if($(this).siblings('*').length == 0) { if($(this).siblings('*').length == 0) {
var _parentH = $(this).parent('*').outerHeight(); var _parentH = $(this).parent('*').outerHeight();
$(this).css('height', _parentH); $(this).css('height', _parentH);
} }
}); });
$iContents.find('#orbit-bar').hide(); iContents.find('#orbit-bar').hide();
$iContents.find('.main_wrap').css('margin-top', 0); iContents.find('.main_wrap').css('margin-top', 0);
$iContents.find('a').not('.edit_link a').on('click', function(event) { iContents.find('a').not('.edit_link a').on('click', function(event) {
event.preventDefault(); event.preventDefault();
}); }).css('cursor', 'default');
}
$('#pageslide_iframe').load(function() {
var $iContents = $(this).contents(),
$pc = $iContents.find('.page_content');
$(this).get(0).contentWindow.externalFunction(iFrameFunction, $iContents, $pc);
}); });
} }
function pageSetting(id, edit) { function pageSetting(id, edit) {
@ -375,7 +378,6 @@ $(function() {
if(_val) { if(_val) {
$.each(_data, function(index, val) { $.each(_data, function(index, val) {
if(_val == val.main[1]) { if(_val == val.main[1]) {
getView(val.main[1]);
$.each(val.sub, function(index, val) { $.each(val.sub, function(index, val) {
var _selected = _select && $(this)[1] == _select.sub ? 'selected="selected"' : ''; var _selected = _select && $(this)[1] == _select.sub ? 'selected="selected"' : '';
$subSelete.append('<option value="' + $(this)[1] + '" ' + _selected.sub + '>' + $(this)[0] + '</option>'); $subSelete.append('<option value="' + $(this)[1] + '" ' + _selected.sub + '>' + $(this)[0] + '</option>');
@ -383,6 +385,7 @@ $(function() {
$.each(val.count, function(index, val) { $.each(val.count, function(index, val) {
$pageCount.append('<option value="' + val + '" ' + (_select && _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>');
}); });
getView(val.main[1]);
$pageDivCount.show(); $pageDivCount.show();
if(event.target.id == 'page_module_app_id') { if(event.target.id == 'page_module_app_id') {

View File

@ -46,14 +46,14 @@ $(function() {
if(_val) { if(_val) {
$.each(_data, function(index, val) { $.each(_data, function(index, val) {
if(_val == val.main[1]) { if(_val == val.main[1]) {
getView(val.main[1]);
$.each(val.sub, function(index, val) { $.each(val.sub, function(index, val) {
var _selected = _select && $(this)[1] == _select.sub ? 'selected="selected"' : ''; var _selected = _select && $(this)[1] == _select.sub ? 'selected="selected"' : '';
$subSelete.append('<option value="' + $(this)[1] + '" ' + _selected.sub + '>' + $(this)[0] + '</option>'); $subSelete.append('<option value="' + $(this)[1] + '" ' + _selected.sub + '>' + $(this)[0] + '</option>');
}); });
$.each(val.count, function(index, val) { $.each(val.count, function(index, val) {
$pageCount.append('<option value="' + val + '" ' + (_select && _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>');
}); });
getView(val.main[1]);
if(event.target.id == 'page_part_module_app') { if(event.target.id == 'page_part_module_app') {
$pageCategory.empty(); $pageCategory.empty();

View File

@ -29,12 +29,11 @@
<% end -%> <% end -%>
<% if @edit %> <% if @edit %>
<script> <script>
$(document).ajaxStop(function() { function externalFunction(Fn, iContents, pc) {
$('a').not('.backend_edit').on('click', function(e){ $(document).ajaxStop(function() {
e.preventDefault(); Fn(iContents, pc);
}); });
$('a').not('.backend_edit').css("cursor", "default"); };
});
</script> </script>
<style> <style>
.body { .body {