Fix view so that bib preview only shows for bib files

This commit is contained in:
Shane Kilkelly 2016-05-18 11:14:24 +01:00
parent 78e52d8c96
commit 8621d497b4
2 changed files with 2 additions and 5 deletions

View file

@ -19,10 +19,7 @@ div.binary-file.full-size(
onabort="sl_binaryFilePreviewError()" onabort="sl_binaryFilePreviewError()"
) )
p( div(ng-if="(['bib'].indexOf(extension(openFile)) > -1) && !bibtex.error", ng-init="loadBibtexFilePreview()")
ng-if="(['bib'].indexOf(extension(openFile)) > -1) && !bibtex.error"
ng-init="loadBibtexFilePreview()"
)
div(ng-if="bibtex.loading") div(ng-if="bibtex.loading")
| #{translate('loading')}... | #{translate('loading')}...
div.bib-preview(ng-if="!bibtex.loading && !bibtex.error") div.bib-preview(ng-if="!bibtex.loading && !bibtex.error")

View file

@ -41,7 +41,7 @@ define [
guide = document.querySelector('.file-tree-inner') guide = document.querySelector('.file-tree-inner')
table_wrap = document.querySelector('.bib-preview .scroll-container') table_wrap = document.querySelector('.bib-preview .scroll-container')
if table_wrap if table_wrap
desired_height = guide.offsetHeight - 60 desired_height = guide.offsetHeight - 44
if table_wrap.offsetHeight > desired_height if table_wrap.offsetHeight > desired_height
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'