mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Force reload BinaryFile view when a new object is selected.
This commit is contained in:
parent
2e2354c574
commit
939c7a8c72
2 changed files with 14 additions and 10 deletions
|
@ -9,4 +9,12 @@ define [
|
||||||
|
|
||||||
openFile: (file) ->
|
openFile: (file) ->
|
||||||
@$scope.ui.view = "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
|
$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 = () =>
|
window.sl_binaryFilePreviewError = () =>
|
||||||
$scope.failedLoad = true
|
$scope.failedLoad = true
|
||||||
$scope.$apply()
|
$scope.$apply()
|
||||||
|
@ -61,6 +52,11 @@ define [
|
||||||
table_wrap.style.height = desired_height + 'px'
|
table_wrap.style.height = desired_height + 'px'
|
||||||
table_wrap.style['max-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()
|
$scope.loadBibtexIfRequired()
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue