mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Only show synctex controls when pdf layout is open
This commit is contained in:
parent
1cf508356c
commit
98d601fb66
3 changed files with 11 additions and 17 deletions
|
@ -33,7 +33,7 @@ div.full-size(
|
|||
include ./pdf
|
||||
|
||||
.ui-layout-resizer-controls.synctex-controls(
|
||||
ng-show="!!pdf.url && settings.pdfViewer == 'pdfjs' && showControls"
|
||||
ng-show="!!pdf.url && settings.pdfViewer == 'pdfjs'"
|
||||
ng-controller="PdfSynctexController"
|
||||
)
|
||||
a.btn.btn-default.btn-xs(
|
||||
|
|
|
@ -72,11 +72,16 @@ define [
|
|||
repositionControls = () ->
|
||||
state = element.layout().readState()
|
||||
if state.east?
|
||||
element.find("> .ui-layout-resizer-controls").css({
|
||||
position: "absolute"
|
||||
right: state.east.size
|
||||
"z-index": 10
|
||||
})
|
||||
controls = element.find("> .ui-layout-resizer-controls")
|
||||
if state.east.initClosed
|
||||
controls.hide()
|
||||
else
|
||||
controls.show()
|
||||
controls.css({
|
||||
position: "absolute"
|
||||
right: state.east.size
|
||||
"z-index": 10
|
||||
})
|
||||
|
||||
resetOpenStates = () ->
|
||||
state = element.layout().readState()
|
||||
|
|
|
@ -223,17 +223,6 @@ define [
|
|||
]
|
||||
|
||||
App.controller "PdfSynctexController", ["$scope", "synctex", "ide", ($scope, synctex, ide) ->
|
||||
$scope.showControls = true
|
||||
$scope.$on "layout:pdf:resize", (event, data) ->
|
||||
if data.east.initClosed
|
||||
$scope.showControls = false
|
||||
else
|
||||
$scope.showControls = true
|
||||
|
||||
setTimeout () ->
|
||||
$scope.$digest()
|
||||
, 0
|
||||
|
||||
@cursorPosition = null
|
||||
ide.$scope.$on "cursor:editor:update", (event, @cursorPosition) =>
|
||||
|
||||
|
|
Loading…
Reference in a new issue