From b649c13c17f2572f5ebc3ee9ba9ef24002e39d59 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Thu, 19 May 2016 11:25:24 +0100 Subject: [PATCH] Eliminate weird flicker when loading bibtex --- services/web/app/views/project/editor/binary-file.jade | 3 ++- .../ide/binary-files/controllers/BinaryFileController.coffee | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/services/web/app/views/project/editor/binary-file.jade b/services/web/app/views/project/editor/binary-file.jade index 1420fb4e9f..4f451f0020 100644 --- a/services/web/app/views/project/editor/binary-file.jade +++ b/services/web/app/views/project/editor/binary-file.jade @@ -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") diff --git a/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee b/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee index 147a0b829f..124393d037 100644 --- a/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee +++ b/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee @@ -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