Save folder expansion state to local storage

This commit is contained in:
James Allen 2014-06-23 17:28:05 +01:00
parent cc0d45c678
commit 6f17e0bb82

View file

@ -2,10 +2,11 @@ define [
"base" "base"
], (App) -> ], (App) ->
App.controller "FileTreeFolderController", ["$scope", "ide", "$modal", ($scope, ide, $modal) -> App.controller "FileTreeFolderController", ["$scope", "ide", "$modal", ($scope, ide, $modal) ->
$scope.expanded = false $scope.expanded = $.localStorage("folder.#{$scope.entity.id}.expanded") or false
$scope.toggleExpanded = () -> $scope.toggleExpanded = () ->
$scope.expanded = !$scope.expanded $scope.expanded = !$scope.expanded
$.localStorage("folder.#{$scope.entity.id}.expanded", $scope.expanded)
$scope.onDrop = (events, ui) -> $scope.onDrop = (events, ui) ->
source = $(ui.draggable).scope().entity source = $(ui.draggable).scope().entity