Skip to content

Commit

Permalink
Added "Disable on responsive layouts" option.
Browse files Browse the repository at this point in the history
  • Loading branch information
liviucmg committed Mar 10, 2016
1 parent 280aabe commit 5df554b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions js/theia-sticky-sidebar.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*!
* Theia Sticky Sidebar v1.3.0
* Theia Sticky Sidebar v1.3.1
* https://github.com/WeCodePixels/theia-sticky-sidebar
*
* Glues your website's sidebars, making them permanently visible while scrolling.
*
* Copyright 2013-2014 WeCodePixels and other contributors
* Copyright 2013-2016 WeCodePixels and other contributors
* Released under the MIT license
*/

Expand All @@ -16,6 +16,7 @@
'additionalMarginBottom': 0,
'updateSidebarHeight': true,
'minWidth': 0,
'disableOnResponsiveLayouts': true,
'sidebarBehavior': 'modern'
};
options = $.extend(defaults, options);
Expand Down Expand Up @@ -160,9 +161,11 @@
}

// Stop if the sidebar width is larger than the container width (e.g. the theme is responsive and the sidebar is now below the content)
if (o.sidebar.outerWidth(true) + 50 > o.container.width()) {
resetSidebar();
return;
if (o.options.disableOnResponsiveLayouts) {
if (o.sidebar.outerWidth(true) + 50 > o.container.width()) {
resetSidebar();
return;
}
}

var scrollTop = $(document).scrollTop();
Expand Down

0 comments on commit 5df554b

Please sign in to comment.