From 82737e22807860d3ae6118eae3a5ec37241f0544 Mon Sep 17 00:00:00 2001 From: bgamard Date: Sat, 7 Mar 2020 17:56:01 +0100 Subject: [PATCH] Closes #334: highlight previously opened file --- .../src/app/docs/controller/document/DocumentDefault.js | 1 - .../src/app/docs/controller/document/DocumentViewContent.js | 5 +++-- .../main/webapp/src/partial/docs/document.view.content.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentDefault.js b/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentDefault.js index 0e158675..6797c8df 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentDefault.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentDefault.js @@ -13,7 +13,6 @@ angular.module('docs').controller('DocumentDefault', function ($scope, $rootScop $scope.loadFiles = function () { Restangular.one('file/list').get().then(function (data) { $scope.files = data.files; - // TODO Keep currently uploading files }); }; $scope.loadFiles(); diff --git a/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentViewContent.js b/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentViewContent.js index f410c64c..9429004c 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentViewContent.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentViewContent.js @@ -5,6 +5,7 @@ */ angular.module('docs').controller('DocumentViewContent', function ($scope, $rootScope, $stateParams, Restangular, $dialog, $state, Upload, $translate, $uibModal) { $scope.displayMode = _.isUndefined(localStorage.fileDisplayMode) ? 'grid' : localStorage.fileDisplayMode; + $scope.openedFile = undefined; /** * Watch for display mode change. @@ -45,7 +46,6 @@ angular.module('docs').controller('DocumentViewContent', function ($scope, $root $scope.loadFiles = function () { Restangular.one('file/list').get({ id: $stateParams.id }).then(function (data) { $scope.files = data.files; - // TODO Keep currently uploading files }); }; $scope.loadFiles(); @@ -55,7 +55,8 @@ angular.module('docs').controller('DocumentViewContent', function ($scope, $root */ $scope.openFile = function (file, $event) { if ($($event.target).parents('.currently-dragging').length === 0) { - $state.go('document.view.content.file', {id: $stateParams.id, fileId: file.id}) + $scope.openedFile = file; + $state.go('document.view.content.file', { id: $stateParams.id, fileId: file.id }); } }; diff --git a/docs-web/src/main/webapp/src/partial/docs/document.view.content.html b/docs-web/src/main/webapp/src/partial/docs/document.view.content.html index b42c3196..623a24c7 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.view.content.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.view.content.html @@ -161,7 +161,7 @@ - +