Skip to content

Commit

Permalink
Updating offset for sticky toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
xirdneh committed Dec 2, 2016
1 parent 039bbd3 commit e76ad33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions designsafe/common_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
SESSION_COOKIE_DOMAIN = os.environ.get('SESSION_COOKIE_DOMAIN')
# SESSION_ENGINE = 'redis_sessions.session'
# SESSION_REDIS_HOST = 'redis'
SESSION_EXPIRE_AT_BROWSER_CLOSE = True

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.environ.get('DJANGO_DEBUG', 'False') == 'True'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,13 @@
link: function (scope, element, attrs) {
var topClass = attrs.dsFixTop; // get CSS class from directive's attribute value

var offsetTop = $('.site-banner').height();
var navbar = $('.navbar-ds');
var offsetTop = 0;
$win.on('scroll', function (e) {
offsetTop = $('.site-banner').height();
if ($win.scrollTop() >= offsetTop) {
offsetTop = $('.site-banner').height() + (navbar.height() / 2);
if ($win.scrollTop() >= offsetTop) {
element.addClass(topClass);
element.css({top: navbar.position().top + navbar.height()});
} else {
element.removeClass(topClass);
}
Expand Down

0 comments on commit e76ad33

Please sign in to comment.