 ## This code is written from scratch in CoffeeScript
 ## and with a completely different API designed for `client/messagePDF.coffee`.
 
+## Whether user is in print dialog, which forces everything visible
+export printing = false
+
 ## appear's `viewable` function adapted from
 ## https://raw.githubusercontent.com/creativelive/appear/master/dist/appear.js
 export visible = (node) ->
+  return true if printing
   rect = node.getBoundingClientRect()
   windowHeight = window.innerHeight || document.documentElement.clientHeight
   windowWidth = window.innerWidth || document.documentElement.clientWidth

, 50

## Called automatically when needed by `track`
enable = ->
  window.addEventListener 'resize', check, false
  window.addEventListener 'scroll', check, false

## Called automatically when needed by `untrack`
disable = ->

  (rect.right - rect.width) <= 2 * windowWidth
  ## `2 *` and `-` means view anything within one screenful of visible

export tracking = []

checkOne = (tracked) ->
  now = visible tracked.node
