Fix resizing and dragging issues

This commit is contained in:
James Allen 2014-06-27 15:55:08 +01:00
parent b07def6901
commit 562f28f412
5 changed files with 16 additions and 1 deletions

View file

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

View file

@ -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"))?

View file

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

View file

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

View file

@ -10,5 +10,6 @@ define [
element.droppable
greedy: true
hoverClass: "droppable-hover"
accept: attrs.accept
drop: scope.onDropCallback
}