Skip to content

Commit

Permalink
Pseudo code for fitInViewport function
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Altmann committed Jan 27, 2015
1 parent e764ce7 commit eb15905
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/assets/javascripts/visual/push_left_if_necessary.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,15 @@ document.Fairmondo.push_left_if_necessary = ($target) ->
if $target?.offset()?.left + $target.outerWidth() > window_width
$target.css 'left',
window_width - ($target.offset().left + $target.outerWidth())

# function should be called: fitInViewport

# what we should do instead:
# 1. clear $target.css left/right
# 2. check if $target is positioned with a) left b) right c) left+right d) none
# 3. for a and d - use left to reposition
# for b - use right to reposition
# for c - use left and overwrite right and set width per css or so
# -> or just use left all the time and overwrite right, right might be
# ignored anyway if a specific width is set, which would have to be set
# by css then

0 comments on commit eb15905

Please sign in to comment.