Only show synctex controls when pdf layout is open

This commit is contained in:
James Allen 2014-07-21 12:30:34 +01:00
parent 1cf508356c
commit 98d601fb66
3 changed files with 11 additions and 17 deletions

View file

@ -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(

View file

@ -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()

View file

@ -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) =>