From 98d601fb668acfbf27a42103108d8f3ee280907f Mon Sep 17 00:00:00 2001 From: James Allen Date: Mon, 21 Jul 2014 12:30:34 +0100 Subject: [PATCH] Only show synctex controls when pdf layout is open --- services/web/app/views/project/editor/editor.jade | 2 +- .../public/coffee/ide/directives/layout.coffee | 15 ++++++++++----- .../ide/pdf/controllers/PdfController.coffee | 11 ----------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/services/web/app/views/project/editor/editor.jade b/services/web/app/views/project/editor/editor.jade index e0f4160e95..aeeda6acfb 100644 --- a/services/web/app/views/project/editor/editor.jade +++ b/services/web/app/views/project/editor/editor.jade @@ -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( diff --git a/services/web/public/coffee/ide/directives/layout.coffee b/services/web/public/coffee/ide/directives/layout.coffee index 0c798dc912..891d04f647 100644 --- a/services/web/public/coffee/ide/directives/layout.coffee +++ b/services/web/public/coffee/ide/directives/layout.coffee @@ -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() diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 73c9190d49..82e9048dbb 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -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) =>