From 6f17e0bb824ca9843d6a3f1991d2bfa8d657a942 Mon Sep 17 00:00:00 2001 From: James Allen Date: Mon, 23 Jun 2014 17:28:05 +0100 Subject: [PATCH] Save folder expansion state to local storage --- .../ide/file-tree/controllers/FileTreeFolderController.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web/public/coffee/app/ide/file-tree/controllers/FileTreeFolderController.coffee b/services/web/public/coffee/app/ide/file-tree/controllers/FileTreeFolderController.coffee index d8b27b53bf..d9a7d6bda3 100644 --- a/services/web/public/coffee/app/ide/file-tree/controllers/FileTreeFolderController.coffee +++ b/services/web/public/coffee/app/ide/file-tree/controllers/FileTreeFolderController.coffee @@ -2,10 +2,11 @@ define [ "base" ], (App) -> 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.expanded = !$scope.expanded + $.localStorage("folder.#{$scope.entity.id}.expanded", $scope.expanded) $scope.onDrop = (events, ui) -> source = $(ui.draggable).scope().entity