handle fullscreen mode in pdfng

default to scale = 1 when containing div size is zero
This commit is contained in:
Brian Gough 2014-12-08 10:28:02 +00:00
parent 0ae83d9be4
commit 89d63c4f44

View file

@ -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', () ->