Skip to content
Browse files

QUICK-FIX Allow passing in content selector

- This will allow us to specify which container to compare to when
  determining whether or not to have a sticky detail view.
  • Loading branch information...
1 parent 62837fe commit 592da3a79e4f224b091525c7787f9bb9482d40d6 @jawsthegame jawsthegame committed Feb 26, 2013
Showing with 6 additions and 2 deletions.
  1. +1 −1 package.json
  2. +5 −1 views/detail_view.coffee
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "quips",
- "version": "0.0.43",
+ "version": "0.0.44",
"dependencies": {
"coffee-script": "1.3.3",
"jqueryify2": "0.0.1",
View
6 views/detail_view.coffee
@@ -29,7 +29,11 @@ class DetailView extends View
# Only stick if the user will have to scroll -
# that is, only if a sibling view is larger than the current window height
- contentHeight = Math.max($(x).height() for x in @$el.parent().siblings())
+ contentHeight = if @opts?.contentSelector?
+ $(@opts.contentSelector).height()
+ else
+ Math.max($(x).height() for x in @$el.parent().siblings())
+
if @opts?.sticky and contentHeight > $(window).height()
Sticky.stickify @$el,
padding: @opts?.stickyPadding or 0

0 comments on commit 592da3a

Please sign in to comment.
Something went wrong with that request. Please try again.