Просмотр исходного кода

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

Brian Gough 12 лет назад
Родитель
Сommit
85750dfeb6

+ 6 - 2
services/web/public/coffee/ide/pdfng/directives/pdfPage.coffee

@@ -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) ->

+ 3 - 4
services/web/public/coffee/ide/pdfng/directives/pdfRenderer.coffee

@@ -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)