mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Show PDF button in toolbar if file tree is closed in PDF flat view
This commit is contained in:
parent
93f2969be5
commit
6bfefea5cb
7 changed files with 47 additions and 19 deletions
|
@ -46,14 +46,15 @@ aside#file-tree(ng-controller="FileTreeController").full-size
|
|||
ng-class="{ 'no-toolbar': !permissions.write }"
|
||||
)
|
||||
|
||||
div(ng-show="ui.pdfLayout == 'flat' && (ui.view == 'editor' || ui.view == 'pdf')")
|
||||
div(ng-show="ui.pdfLayout == 'flat' && (ui.view == 'editor' || ui.view == 'pdf' || ui.view == 'file')")
|
||||
ul.list-unstyled.file-tree-list
|
||||
li(
|
||||
ng-class="{ 'selected': ui.view == 'pdf' }"
|
||||
ng-controller="PdfViewToggleController"
|
||||
)
|
||||
.entity
|
||||
.entity-name(
|
||||
ng-click="ui.view = 'pdf'"
|
||||
ng-click="togglePdfView()"
|
||||
)
|
||||
i.fa.fa-fw.toggle
|
||||
i.fa.fa-fw.fa-file-pdf-o
|
||||
|
|
|
@ -14,6 +14,17 @@ header.toolbar.toolbar-header(ng-cloak, ng-hide="state.loading")
|
|||
tooltip-append-to-body="true"
|
||||
)
|
||||
i.fa.fa-fw.fa-level-up
|
||||
span(ng-controller="PdfViewToggleController")
|
||||
a(
|
||||
href,
|
||||
ng-show="ui.pdfLayout == 'flat' && fileTreeClosed",
|
||||
tooltip="PDF",
|
||||
tooltip-placement="bottom",
|
||||
tooltip-append-to-body="true",
|
||||
ng-click="togglePdfView()",
|
||||
ng-class="{ 'active': ui.view == 'pdf' }"
|
||||
)
|
||||
i.fa.fa-file-pdf-o
|
||||
|
||||
.toolbar-center.project-name(ng-controller="ProjectNameController")
|
||||
span.name(
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
define [
|
||||
"ide/pdf/controllers/PdfController"
|
||||
"ide/pdf/controllers/PdfViewToggleController"
|
||||
"ide/pdf/directives/pdfJs"
|
||||
], () ->
|
||||
class PdfManager
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
define [
|
||||
"base"
|
||||
], (App) ->
|
||||
App.controller "PdfViewToggleController", ($scope) ->
|
||||
$scope.togglePdfView = () ->
|
||||
if $scope.ui.view == "pdf"
|
||||
$scope.ui.view = "editor"
|
||||
else
|
||||
$scope.ui.view = "pdf"
|
||||
|
||||
$scope.fileTreeClosed = false
|
||||
$scope.$on "layout:main:resize", (e, state) ->
|
||||
if state.west.initClosed
|
||||
$scope.fileTreeClosed = true
|
||||
else
|
||||
$scope.fileTreeClosed = false
|
||||
$scope.$apply()
|
|
@ -72,7 +72,7 @@ aside#file-tree {
|
|||
color: @link-color;
|
||||
border-right: 4px solid @link-color;
|
||||
font-weight: bold;
|
||||
i.fa-folder-open, i.fa-folder, i.fa-file, i.fa-image {
|
||||
i.fa-folder-open, i.fa-folder, i.fa-file, i.fa-image, i.fa-file-pdf-o {
|
||||
color: @link-color;
|
||||
}
|
||||
padding-right: 32px;
|
||||
|
|
|
@ -74,20 +74,6 @@
|
|||
}
|
||||
|
||||
.pdf .toolbar {
|
||||
.log-btn {
|
||||
&.active, &:active {
|
||||
.label {
|
||||
display: none;
|
||||
}
|
||||
color: white;
|
||||
background-color: @link-color;
|
||||
.box-shadow(inset 0 3px 5px rgba(0, 0, 0, 0.225));
|
||||
&:hover {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.toolbar-right {
|
||||
margin-right: @line-height-computed / 2;
|
||||
a {
|
||||
|
|
|
@ -16,14 +16,25 @@
|
|||
a:not(.btn) {
|
||||
display: inline-block;
|
||||
color: @gray-light;
|
||||
padding: 5px 12px 6px;
|
||||
margin: 0;
|
||||
padding: 4px 10px 5px;
|
||||
margin: 1px 2px;
|
||||
border-radius: @border-radius-small;
|
||||
&:hover {
|
||||
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
|
||||
color: @gray-dark;
|
||||
text-decoration: none;
|
||||
}
|
||||
&.active, &:active {
|
||||
.label {
|
||||
display: none;
|
||||
}
|
||||
color: white;
|
||||
background-color: @link-color;
|
||||
.box-shadow(inset 0 3px 5px rgba(0, 0, 0, 0.225));
|
||||
&:hover {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn-full-height {
|
||||
|
@ -81,6 +92,7 @@
|
|||
height: 32px;
|
||||
a {
|
||||
padding: 4px 2px 2px;
|
||||
margin: 0;
|
||||
margin-left: 6px;
|
||||
}
|
||||
.toolbar-right {
|
||||
|
|
Loading…
Reference in a new issue