mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Force reload BinaryFile view when a new object is selected.
This commit is contained in:
@@ -9,4 +9,12 @@ define [
|
||||
|
||||
openFile: (file) ->
|
||||
@$scope.ui.view = "file"
|
||||
@$scope.openFile = file
|
||||
@$scope.openFile = null
|
||||
@$scope.$apply()
|
||||
window.setTimeout(
|
||||
() =>
|
||||
@$scope.openFile = file
|
||||
@$scope.$apply()
|
||||
, 0
|
||||
, this
|
||||
)
|
||||
|
||||
@@ -13,15 +13,6 @@ define [
|
||||
|
||||
$scope.failedLoad = false
|
||||
|
||||
$rootScope.$on 'entity:selected', () ->
|
||||
$scope.failedLoad = false
|
||||
$scope.loadBibtexIfRequired()
|
||||
|
||||
$scope.loadBibtexIfRequired = () ->
|
||||
if $scope.extension($scope.openFile) == 'bib'
|
||||
$scope.bibtexPreview.data = null
|
||||
$scope.loadBibtexFilePreview()
|
||||
|
||||
window.sl_binaryFilePreviewError = () =>
|
||||
$scope.failedLoad = true
|
||||
$scope.$apply()
|
||||
@@ -61,6 +52,11 @@ define [
|
||||
table_wrap.style.height = desired_height + 'px'
|
||||
table_wrap.style['max-height'] = desired_height + 'px'
|
||||
|
||||
$scope.loadBibtexIfRequired = () ->
|
||||
if $scope.extension($scope.openFile) == 'bib'
|
||||
$scope.bibtexPreview.data = null
|
||||
$scope.loadBibtexFilePreview()
|
||||
|
||||
$scope.loadBibtexIfRequired()
|
||||
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user