mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
handle fullscreen mode in pdfng
default to scale = 1 when containing div size is zero
This commit is contained in:
parent
0ae83d9be4
commit
89d63c4f44
1 changed files with 13 additions and 2 deletions
|
@ -48,7 +48,9 @@ define [
|
|||
@setScale = (scale, containerHeight, containerWidth) ->
|
||||
$scope.loaded.then () ->
|
||||
scale = {} if not scale?
|
||||
if scale.scaleMode == 'scale_mode_fit_width'
|
||||
if containerHeight == 0 or containerWidth == 0
|
||||
numScale = 1
|
||||
else if scale.scaleMode == 'scale_mode_fit_width'
|
||||
# TODO make this dynamic
|
||||
numScale = (containerWidth - 40) / ($scope.pdfPageSize[1])
|
||||
else if scale.scaleMode == 'scale_mode_fit_height'
|
||||
|
@ -248,12 +250,21 @@ define [
|
|||
]
|
||||
#scope.$apply()
|
||||
|
||||
scope.$on 'layout:pdf:resize', () ->
|
||||
scope.$on 'layout:main:resize', () ->
|
||||
# console.log 'GOT LAYOUT-RESIZE EVENT'
|
||||
scope.parentSize = [
|
||||
element.innerHeight(),
|
||||
element.innerWidth()
|
||||
]
|
||||
scope.$apply()
|
||||
|
||||
|
||||
scope.$on 'layout:pdf:resize', () ->
|
||||
console.log 'GOT LAYOUT-RESIZE EVENT'
|
||||
scope.parentSize = [
|
||||
element.innerHeight(),
|
||||
element.innerWidth()
|
||||
]
|
||||
#scope.$apply()
|
||||
|
||||
element.on 'scroll', () ->
|
||||
|
|
Loading…
Reference in a new issue