Merge pull request #1183 from benmcmahon100/patch-6

Combined UI Fixes
This commit is contained in:
Quincy Larson
2015-07-02 13:46:33 -07:00
4 changed files with 222 additions and 177 deletions

View File

@ -349,6 +349,48 @@ $(document).ready(function() {
});
};
//fakeiphone positioning hotfix
if($('.iphone-position').html() !==undefined || $('.iphone').html() !== undefined){
var startIphonePosition = parseInt($('.iphone-position').css('top').replace('px', ''));
var startIphone = parseInt($('.iphone').css('top').replace('px', ''));
$(window).on('scroll', function(){
if((($('.courseware-height').height() + $('.courseware-height').offset().top)-$(window).scrollTop()-$('.iphone-position').height()) <= 0){
$('.iphone-position').css('top', startIphonePosition+(($('.courseware-height').height() + $('.courseware-height').offset().top)-$(window).scrollTop()-$('.iphone-position').height()));
$('.iphone').css('top', startIphonePosition+(($('.courseware-height').height() + $('.courseware-height').offset().top)-$(window).scrollTop()-$('.iphone-position').height())+120);
}
else{
$('.iphone-position').css('top', startIphonePosition);
$('.iphone').css('top', startIphone);
}
});
}
if($('.scroll-locker') != undefined){
function lockTop(initOff){
$(window).scroll(function() {
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', '75%').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', '75%').css('overflow-y', 'auto').css('overflow-x', 'hidden');
$('.well').css('margin-right', '6px');
}
}
else {
$('.scroll-locker').css('position', 'inherit').css('top', 'inherit').css('width', '100%').css('max-height', '').css('overflow-y', 'auto').css('overflow-x', 'hidden');
$('.well').css('margin-right', '');
}
});
}
var initOff = ($('.scroll-locker').offset().top - $(window).scrollTop());
lockTop(initOff);
$(window).on('resize', function(){
lockTop(initOff);
});
}
$('#comment-button').on('click', commentSubmitButtonHandler);
});

View File

@ -18,6 +18,7 @@ block content
.row(ng-controller="pairedWithController")
.col-xs-12.col-sm-12.col-md-4.col-lg-3
.scroll-locker
#testCreatePanel.well
h3.text-center.negative-10= name
.positive-15.positive-15-bottom

View File

@ -21,6 +21,7 @@ block content
script(src='/js/lib/codemirror/addon/emmet/emmet.js')
.row.courseware-height
.col-xs-12.col-sm-12.col-md-3.col-lg-3
.scroll-locker
.well
.row
.col-xs-12

View File

@ -16,6 +16,7 @@ block content
script(src='/js/lib/coursewares/sandbox.js')
.row
.col-xs-12.col-sm-12.col-md-4.bonfire-top
.scroll-locker
#testCreatePanel
h1.text-center= name
.well