mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 05:05:27 -05:00
Merge branch 'master' of github.com:sharelatex/web-sharelatex
This commit is contained in:
commit
34bfdcc246
7 changed files with 46 additions and 24 deletions
|
@ -53,7 +53,13 @@ block content
|
||||||
|
|
||||||
include ./editor/share
|
include ./editor/share
|
||||||
|
|
||||||
#ide-body(ng-cloak, layout="main", ng-hide="state.loading", resize-on="layout:chat:resize")
|
#ide-body(
|
||||||
|
ng-cloak,
|
||||||
|
layout="main",
|
||||||
|
ng-hide="state.loading",
|
||||||
|
resize-on="layout:chat:resize",
|
||||||
|
minimum-restore-size-west="130"
|
||||||
|
)
|
||||||
.ui-layout-west
|
.ui-layout-west
|
||||||
include ./editor/file-tree
|
include ./editor/file-tree
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ div.full-size(
|
||||||
resize-on="layout:main:resize"
|
resize-on="layout:main:resize"
|
||||||
resize-proportionally="true"
|
resize-proportionally="true"
|
||||||
initial-size-east="'50%'"
|
initial-size-east="'50%'"
|
||||||
|
minimum-restore-size-east="300"
|
||||||
)
|
)
|
||||||
.ui-layout-center
|
.ui-layout-center
|
||||||
.loading-panel(ng-show="!editor.sharejs_doc || editor.opening")
|
.loading-panel(ng-show="!editor.sharejs_doc || editor.opening")
|
||||||
|
|
|
@ -46,10 +46,13 @@ aside#file-tree(ng-controller="FileTreeController", ng-class="{ 'multi-selected'
|
||||||
ng-controller="FileTreeRootFolderController",
|
ng-controller="FileTreeRootFolderController",
|
||||||
ng-class="{ 'no-toolbar': !permissions.write }"
|
ng-class="{ 'no-toolbar': !permissions.write }"
|
||||||
)
|
)
|
||||||
|
ul.list-unstyled.file-tree-list(
|
||||||
div(ng-show="ui.pdfLayout == 'flat' && (ui.view == 'editor' || ui.view == 'pdf' || ui.view == 'file')")
|
droppable="permissions.write"
|
||||||
ul.list-unstyled.file-tree-list
|
accept=".entity-name"
|
||||||
|
on-drop-callback="onDrop"
|
||||||
|
)
|
||||||
li(
|
li(
|
||||||
|
ng-show="ui.pdfLayout == 'flat' && (ui.view == 'editor' || ui.view == 'pdf' || ui.view == 'file')"
|
||||||
ng-class="{ 'selected': ui.view == 'pdf' }"
|
ng-class="{ 'selected': ui.view == 'pdf' }"
|
||||||
ng-controller="PdfViewToggleController"
|
ng-controller="PdfViewToggleController"
|
||||||
)
|
)
|
||||||
|
@ -61,11 +64,6 @@ aside#file-tree(ng-controller="FileTreeController", ng-class="{ 'multi-selected'
|
||||||
i.fa.fa-fw.fa-file-pdf-o
|
i.fa.fa-fw.fa-file-pdf-o
|
||||||
| PDF
|
| PDF
|
||||||
|
|
||||||
ul.list-unstyled.file-tree-list(
|
|
||||||
droppable="permissions.write"
|
|
||||||
accept=".entity-name"
|
|
||||||
on-drop-callback="onDrop"
|
|
||||||
)
|
|
||||||
file-entity(
|
file-entity(
|
||||||
entity="entity",
|
entity="entity",
|
||||||
permissions="permissions",
|
permissions="permissions",
|
||||||
|
|
|
@ -37,8 +37,12 @@ define [
|
||||||
|
|
||||||
# Restore previously recorded state
|
# Restore previously recorded state
|
||||||
if (state = ide.localStorage("layout.#{name}"))?
|
if (state = ide.localStorage("layout.#{name}"))?
|
||||||
options.west = state.west
|
if state.east?
|
||||||
|
if !attrs.minimumRestoreSizeEast? or (state.east.size >= attrs.minimumRestoreSizeEast and !state.east.initClosed)
|
||||||
options.east = state.east
|
options.east = state.east
|
||||||
|
if state.west?
|
||||||
|
if !attrs.minimumRestoreSizeWest? or (state.west.size >= attrs.minimumRestoreSizeWest and !state.west.initClosed)
|
||||||
|
options.west = state.west
|
||||||
|
|
||||||
repositionControls = () ->
|
repositionControls = () ->
|
||||||
state = element.layout().readState()
|
state = element.layout().readState()
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
define [
|
define [
|
||||||
"base"
|
"base"
|
||||||
], (App) ->
|
], (App) ->
|
||||||
|
MAX_PROJECT_NAME_LENGTH = 150
|
||||||
App.controller "ProjectNameController", ["$scope", "settings", "ide", ($scope, settings, ide) ->
|
App.controller "ProjectNameController", ["$scope", "settings", "ide", ($scope, settings, ide) ->
|
||||||
$scope.state =
|
$scope.state =
|
||||||
renaming: false
|
renaming: false
|
||||||
|
@ -12,11 +13,12 @@ define [
|
||||||
$scope.$emit "project:rename:start"
|
$scope.$emit "project:rename:start"
|
||||||
|
|
||||||
$scope.finishRenaming = () ->
|
$scope.finishRenaming = () ->
|
||||||
|
$scope.state.renaming = false
|
||||||
newName = $scope.inputs.name
|
newName = $scope.inputs.name
|
||||||
if newName.length < 150
|
if !newName? or newName.length == 0 or newName.length > MAX_PROJECT_NAME_LENGTH
|
||||||
|
return
|
||||||
$scope.project.name = newName
|
$scope.project.name = newName
|
||||||
settings.saveProjectSettings({name: $scope.project.name})
|
settings.saveProjectSettings({name: $scope.project.name})
|
||||||
$scope.state.renaming = false
|
|
||||||
|
|
||||||
ide.socket.on "projectNameUpdated", (name) ->
|
ide.socket.on "projectNameUpdated", (name) ->
|
||||||
$scope.$apply () ->
|
$scope.$apply () ->
|
||||||
|
|
|
@ -257,8 +257,10 @@ define [
|
||||||
modalInstance.result.then (project_id) ->
|
modalInstance.result.then (project_id) ->
|
||||||
window.location = "/project/#{project_id}"
|
window.location = "/project/#{project_id}"
|
||||||
|
|
||||||
|
MAX_PROJECT_NAME_LENGTH = 150
|
||||||
$scope.renameProject = (project, newName) ->
|
$scope.renameProject = (project, newName) ->
|
||||||
if newName.length < 150
|
if !newName? or newName.length == 0 or newName.length > MAX_PROJECT_NAME_LENGTH
|
||||||
|
return
|
||||||
project.name = newName
|
project.name = newName
|
||||||
queuedHttp.post "/project/#{project.id}/rename", {
|
queuedHttp.post "/project/#{project.id}/rename", {
|
||||||
newProjectName: project.name
|
newProjectName: project.name
|
||||||
|
|
|
@ -109,6 +109,15 @@
|
||||||
}
|
}
|
||||||
a.rename {
|
a.rename {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
|
display: inline-block;
|
||||||
|
color: @gray-light;
|
||||||
|
padding: 5px;
|
||||||
|
border-radius: @border-radius-small;
|
||||||
|
&:hover {
|
||||||
|
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
|
||||||
|
color: @gray-dark;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
a.rename {
|
a.rename {
|
||||||
|
|
Loading…
Reference in a new issue