@ -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);
|
$('#comment-button').on('click', commentSubmitButtonHandler);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ block content
|
|||||||
|
|
||||||
.row(ng-controller="pairedWithController")
|
.row(ng-controller="pairedWithController")
|
||||||
.col-xs-12.col-sm-12.col-md-4.col-lg-3
|
.col-xs-12.col-sm-12.col-md-4.col-lg-3
|
||||||
|
.scroll-locker
|
||||||
#testCreatePanel.well
|
#testCreatePanel.well
|
||||||
h3.text-center.negative-10= name
|
h3.text-center.negative-10= name
|
||||||
.positive-15.positive-15-bottom
|
.positive-15.positive-15-bottom
|
||||||
|
@ -21,6 +21,7 @@ block content
|
|||||||
script(src='/js/lib/codemirror/addon/emmet/emmet.js')
|
script(src='/js/lib/codemirror/addon/emmet/emmet.js')
|
||||||
.row.courseware-height
|
.row.courseware-height
|
||||||
.col-xs-12.col-sm-12.col-md-3.col-lg-3
|
.col-xs-12.col-sm-12.col-md-3.col-lg-3
|
||||||
|
.scroll-locker
|
||||||
.well
|
.well
|
||||||
.row
|
.row
|
||||||
.col-xs-12
|
.col-xs-12
|
||||||
|
@ -16,6 +16,7 @@ block content
|
|||||||
script(src='/js/lib/coursewares/sandbox.js')
|
script(src='/js/lib/coursewares/sandbox.js')
|
||||||
.row
|
.row
|
||||||
.col-xs-12.col-sm-12.col-md-4.bonfire-top
|
.col-xs-12.col-sm-12.col-md-4.bonfire-top
|
||||||
|
.scroll-locker
|
||||||
#testCreatePanel
|
#testCreatePanel
|
||||||
h1.text-center= name
|
h1.text-center= name
|
||||||
.well
|
.well
|
||||||
|
Reference in New Issue
Block a user