Skip to content

Commit

Permalink
SAK-31723 - Subsites position is not in right position (sakaiproject#…
Browse files Browse the repository at this point in the history
  • Loading branch information
SedueRey authored and juanjmerono committed Sep 7, 2016
1 parent 3cb429b commit b6da073
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,20 +286,6 @@ $PBJQ(document).ready(function(){
closeText: '<img src="/library/image/silk/cross.png" alt="close">'
});

// Shows or hides the subsites in a popout div. This isn't used unless
// portal.showSubsitesAsFlyout is set to true in sakai.properties.
$PBJQ("#toggleSubsitesLink").click(function (e) {
var subsitesLink = $PBJQ(this);
if($PBJQ('#subSites').css('display') == 'block') {
$PBJQ('#subSites').hide();
$PBJQ('#subSites').removeClass('floating');
} else {
var position = subsitesLink.position();
$PBJQ('#subSites').css({'position': 'absolute','display': 'block','left': position.left + subsitesLink.width() + 6 + 'px','top': position.top + 'px'});
$PBJQ('#subSites').addClass('floating');
}
});

});


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,39 @@ $PBJQ(document).ready(function(){
initialOffset = $("#toolMenu").offset().top - $window.scrollTop();
$PBJQ(window).scroll(function(){
var follow = ($window.height()- padding) > $tools.height();
if($("#toolMenuWrap").css('position') !== 'fixed'
&& follow) {
var _top = (-1 * ( $PBJQ('#toolMenu').height() - $PBJQ("#toggleSubsitesLink").position().top ) );
if($("#toolMenuWrap").css('position') !== 'fixed' && follow) {
if($window.scrollTop() > offset.top) {
$("#toolMenu").stop().animate({
top: $window .scrollTop() - offset.top
top: $window.scrollTop() - offset.top
});
$("#subSites").css('top', ( $window.scrollTop() - offset.top + _top ) );
} else {
$("#toolMenu").stop().animate({
top: 0
});
$("#subSites").css('top', _top );
}
}else{
$("#subSites").css('top', _top );
}
});

// Shows or hides the subsites in a popout div. This isn't used unless
// portal.showSubsitesAsFlyout is set to true in sakai.properties.
$PBJQ("#toggleSubsitesLink").click(function (e) {
var subsitesLink = $PBJQ(this);
if($PBJQ('#subSites').css('display') == 'block') {
$PBJQ('#subSites').hide();
$PBJQ('#subSites').removeClass('floating');
} else {
var position = subsitesLink.position();
var _top = ( -1 * ( $PBJQ('#toolMenu').height() - position.top ) );
$PBJQ('#subSites').css({'display': 'block','left': position.left + subsitesLink.width() + 6 + 'px','top': _top + 'px'});
$PBJQ('#subSites').addClass('floating');
}
});

});

function getCookieVal(cookieName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ body.#{$namespace}toolMenu-collapsed{

nav#subSites{
max-width: #{$tool-menu-width * 2 };
position: relative;
z-index: 9999;
@media #{$desktop}{
min-width: 15em;
}
&.floating{
margin: 0 0 0 7px;
&:after{
Expand Down

0 comments on commit b6da073

Please sign in to comment.