need to set the height of the container to get the pdf spinner working

This commit is contained in:
Brian Gough 2014-12-02 11:01:45 +00:00
parent d6e47c2701
commit 85750dfeb6
2 changed files with 9 additions and 6 deletions

View file

@ -21,8 +21,12 @@ define [
highlightsElement = $(element).find('.highlights-layer')
updatePageSize = (size) ->
element.height(Math.floor(size[0]))
element.width(Math.floor(size[1]))
h = Math.floor(size[0])
w = Math.floor(size[1])
element.height(h)
element.width(w)
canvasElement.height(h)
canvasElement.width(w)
scope.page.sized = true
isVisible = (containerSize) ->

View file

@ -175,11 +175,10 @@ define [
canvas.removeClass('pdf-canvas-new')
addSpinner: (element) ->
element.css({position: 'relative'})
h = element.parent().height()
w = element.parent().width()
h = element.height()
w = element.width()
size = Math.floor(0.5 * Math.min(h, w))
spinner = $('<div style="position: absolute; top: 50%; left:50%; transform: translateX(-50%) translateY(50%);"><i class="fa fa-spinner fa-spin" style="color: #999"></i></div>')
spinner = $('<div style="position: absolute; top: 50%; left:50%; transform: translateX(-50%) translateY(-50%); z-index: 2"><i class="fa fa-spinner fa-spin" style="color: #999"></i></div>')
spinner.css({'font-size' : size + 'px'})
element.append(spinner)