Fix height of report window with JS disabled and archive report link added.

This commit is contained in:
ccd0 2015-05-04 20:28:31 -07:00
parent cf07089d00
commit 24a7311a7a

View File

@ -12,17 +12,17 @@ Report =
ready: ->
$.addStyle Report.css
Report.archive() if Conf['Archive Report']
if $.hasClass doc, 'js-enabled'
new MutationObserver(-> Report.fit '.gc-bubbleDefault').observe d.body,
childList: true
attributes: true
subtree: true
else
Report.fit '.rules'
Report.archive() if Conf['Archive Report']
Report.fit 'body'
fit: (selector) ->
return unless el = $ selector
return unless el = $ selector, doc
dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8
window.resizeBy 0, dy if dy > 0