mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Fix resizing and dragging issues
This commit is contained in:
parent
b07def6901
commit
562f28f412
5 changed files with 16 additions and 1 deletions
|
@ -119,6 +119,7 @@ script(type='text/ng-template', id='entityListItemTemplate')
|
|||
ng-dblclick="startRenaming()"
|
||||
draggable
|
||||
droppable
|
||||
accept=".entity-name"
|
||||
on-drop-callback="onDrop"
|
||||
)
|
||||
div(
|
||||
|
@ -232,6 +233,7 @@ script(type='text/ng-template', id='entityListItemTemplate')
|
|||
ng-if="entity.type == 'folder'"
|
||||
ng-show="expanded"
|
||||
droppable
|
||||
accept=".entity-name"
|
||||
on-drop-callback="onDrop"
|
||||
)
|
||||
file-entity(
|
||||
|
|
|
@ -10,7 +10,7 @@ define [
|
|||
spacing_open: 24
|
||||
spacing_closed: 24
|
||||
onresize: () =>
|
||||
scope.$broadcast "layout:#{name}:resize"
|
||||
scope.$broadcast "layout:resize"
|
||||
|
||||
# Restore previously recorded state
|
||||
if (state = $.localStorage("layout.main"))?
|
||||
|
|
|
@ -58,6 +58,14 @@ define [
|
|||
editor.commands.removeCommand "showSettingsMenu"
|
||||
editor.commands.removeCommand "foldall"
|
||||
|
||||
scope.$on "layout:resize", () ->
|
||||
console.log "LAYOUT RESIZED"
|
||||
editor.resize()
|
||||
|
||||
$(window).on "resize", () ->
|
||||
console.log "WINDOW RESIZED"
|
||||
editor.resize()
|
||||
|
||||
editor.on "changeSelection", () ->
|
||||
cursor = editor.getCursorPosition()
|
||||
scope.$apply () ->
|
||||
|
@ -91,6 +99,9 @@ define [
|
|||
scope.$watch "text", (text) ->
|
||||
if text?
|
||||
editor.setValue(text, -1)
|
||||
session = editor.getSession()
|
||||
session.setUseWrapMode(true)
|
||||
session.setMode(new LatexMode())
|
||||
|
||||
scope.$watch "readOnly", (value) ->
|
||||
editor.setReadOnly !!value
|
||||
|
|
|
@ -10,6 +10,7 @@ define [
|
|||
|
||||
$scope.onDrop = (events, ui) ->
|
||||
source = $(ui.draggable).scope().entity
|
||||
return if !source?
|
||||
ide.fileTreeManager.moveEntity(source, $scope.entity)
|
||||
|
||||
$scope.orderByFoldersFirst = (entity) ->
|
||||
|
|
|
@ -10,5 +10,6 @@ define [
|
|||
element.droppable
|
||||
greedy: true
|
||||
hoverClass: "droppable-hover"
|
||||
accept: attrs.accept
|
||||
drop: scope.onDropCallback
|
||||
}
|
Loading…
Reference in a new issue