Fix height of report window with JS disabled and archive report link added.
This commit is contained in:
parent
cf07089d00
commit
24a7311a7a
@ -12,17 +12,17 @@ Report =
|
|||||||
|
|
||||||
ready: ->
|
ready: ->
|
||||||
$.addStyle Report.css
|
$.addStyle Report.css
|
||||||
|
Report.archive() if Conf['Archive Report']
|
||||||
if $.hasClass doc, 'js-enabled'
|
if $.hasClass doc, 'js-enabled'
|
||||||
new MutationObserver(-> Report.fit '.gc-bubbleDefault').observe d.body,
|
new MutationObserver(-> Report.fit '.gc-bubbleDefault').observe d.body,
|
||||||
childList: true
|
childList: true
|
||||||
attributes: true
|
attributes: true
|
||||||
subtree: true
|
subtree: true
|
||||||
else
|
else
|
||||||
Report.fit '.rules'
|
Report.fit 'body'
|
||||||
Report.archive() if Conf['Archive Report']
|
|
||||||
|
|
||||||
fit: (selector) ->
|
fit: (selector) ->
|
||||||
return unless el = $ selector
|
return unless el = $ selector, doc
|
||||||
dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8
|
dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8
|
||||||
window.resizeBy 0, dy if dy > 0
|
window.resizeBy 0, dy if dy > 0
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user