Eliminate weird flicker when loading bibtex

This commit is contained in:
Shane Kilkelly 2016-05-19 11:25:24 +01:00
parent b70a993572
commit b649c13c17
2 changed files with 3 additions and 2 deletions

View file

@ -20,7 +20,8 @@ div.binary-file.full-size(
)
div(ng-if="(['bib'].indexOf(extension(openFile)) > -1) && !bibtexPreview.error")
div.bib-loading(ng-show="bibtexPreview.loading == true")
div.bib-loading(ng-show="bibtexPreview.loading && !bibtexPreview.error")
| #{translate('loading')}...
div.bib-preview(ng-show="bibtexPreview.data && !bibtexPreview.loading && !bibtexPreview.error")

View file

@ -19,7 +19,7 @@ define [
$scope.loadBibtexIfRequired = () ->
if $scope.extension($scope.openFile) == 'bib'
$scope.bibtexPreview.data = null
$timeout($scope.loadBibtexFilePreview, 0)
$scope.loadBibtexFilePreview()
window.sl_binaryFilePreviewError = () =>
$scope.failedLoad = true