Revised scroll-locker layout. iPhone preview causing some styling issues that will require th dynamic resizing of the preview to fix which may impact the quality of the display

This commit is contained in:
benmcmahon100
2015-08-13 01:20:12 +01:00
parent 2b654ecd83
commit 7910f0ae2c
3 changed files with 117 additions and 117 deletions

View File

@ -310,13 +310,6 @@ $(document).ready(function() {
};
$('#story-submit').on('click', storySubmitButtonHandler);
if($('.editorScrollDiv').html() !== 'undefined'){
function truncateEditor(){$('.editorScrollDiv').css("height",$(window).height()-($('.navbar').height()+$('.footer').height()+100) + "px");}
truncateEditor();
$(window).resize(function(){truncateEditor();});
}
//fakeiphone positioning hotfix
if($('.iphone-position').html() !==undefined || $('.iphone').html() !== undefined){
var startIphonePosition = parseInt($('.iphone-position').css('top').replace('px', ''));
@ -333,34 +326,39 @@ $(document).ready(function() {
});
}
if($('.scroll-locker').html() != undefined){
function lockTop(initOff){
if ($(window).width() >= 992) {
if ((($('.scroll-locker').offset().top - $(window).scrollTop()) + $('.scroll-locker').height()) >= ($('.fcc-footer').offset().top - $(window).scrollTop())) {
$('.scroll-locker').css('position', 'fixed').css('top', initOff).css('width', $($('.scroll-locker').parent()).width()).css('max-height', '85%').css('overflow-y', 'auto').css('overflow-x', 'hidden');
$('.well').css('margin-right', '6px');
}
else {
$('.scroll-locker').css('position', 'fixed').css('bottom', $('.fcc-footer') - (($('.scroll-locker').offset().top - $(window).scrollTop()) + $('.scroll-locker').height()) - ($('.fcc-footer').offset().top - $(window).scrollTop())).css('width', $($('.scroll-locker').parent()).width()).css('max-height', '85%').css('overflow-y', 'auto').css('overflow-x', 'hidden');
$('.well').css('margin-right', '6px');
}
function lockTop(){
if ($(window).width() >= 990) {
if($('.editorScrollDiv').html() !== 'undefined'){
var magiVal = $(window).height()-($('.navbar').height()+$('.footer').height());
if(magiVal < 0){
magiVal = 0;
}
magiVal = $(window).height()-($('.navbar').height()+$('.footer').height());
if(magiVal < 0){
magiVal = 0;
}
$('.editorScrollDiv').css("height", (magiVal-85) + "px");
}
magiVal = $(window).height()-($('.navbar').height()+$('.footer').height());
if(magiVal < 0){
magiVal = 0;
}
$('.scroll-locker').css("min-height", $('.editorScrollDiv').height()).css("height",magiVal-85);
}
else {
$('.editorScrollDiv').css("max-height", 500 + "px");
$('.scroll-locker').css('position', 'inherit').css('top', 'inherit').css('width', '100%').css('max-height', '85%').css('overflow-y', 'auto').css('overflow-x', 'hidden');
$('.well').css('margin-right', '');
}
}
var $scrollLocker = $('.scroll-locker');
if ($scrollLocker.offset()) {
var initOff = $scrollLocker.offset().top - $(window).scrollTop();
lockTop(initOff);
if ($('.scroll-locker').offset()){
$(document).ready(function(){
lockTop();
$(window).on('resize', function(){
lockTop(initOff);
lockTop();
});
$(window).scroll(function() {
lockTop(initOff);
lockTop();
});
$(document).ready(function(){
lockTop(initOff);
});
}
}

View File

@ -22,6 +22,7 @@ block content
.row.courseware-height
.col-xs-12.col-sm-12.col-md-3.col-lg-3
.scroll-locker
.innerMarginFix(style = "width: 99%;")
.well
.row
.col-xs-12

View File

@ -17,6 +17,7 @@ block content
.row(ng-controller="pairedWithController")
.col-xs-12.col-sm-12.col-md-4.col-lg-3
.scroll-locker
.innerMarginFix(style = "width: 99%;")
#testCreatePanel.well
h3.text-center.negative-10= name
.row