diff --git a/docs-parent/TODO b/docs-parent/TODO index e30c553d..e69de29b 100644 --- a/docs-parent/TODO +++ b/docs-parent/TODO @@ -1 +0,0 @@ -- Close button on file preview \ No newline at end of file diff --git a/docs-web/src/main/webapp/js/controller/FileView.js b/docs-web/src/main/webapp/js/controller/FileView.js index a90fb009..9bbd4fe0 100644 --- a/docs-web/src/main/webapp/js/controller/FileView.js +++ b/docs-web/src/main/webapp/js/controller/FileView.js @@ -7,7 +7,7 @@ App.controller('FileView', function($dialog, $state, $stateParams) { var dialog = $dialog.dialog({ keyboard: true, templateUrl: 'partial/file.view.html', - controller: function($scope, $state, $stateParams, Restangular) { + controller: function($scope, $state, $stateParams, Restangular, dialog) { $scope.id = $stateParams.fileId; // Load files @@ -58,9 +58,17 @@ App.controller('FileView', function($dialog, $state, $stateParams) { $scope.openFile = function() { window.open('api/file/' + $scope.id + '/data'); }; + + /** + * Close the file preview. + */ + $scope.closeFile = function () { + dialog.close(); + }; } }); - + + // Returns to document view on file close dialog.open().then(function(result) { if (result == null) { $state.transitionTo('document.view', { id: $stateParams.id }); diff --git a/docs-web/src/main/webapp/partial/file.view.html b/docs-web/src/main/webapp/partial/file.view.html index a4338c57..639b8c88 100644 --- a/docs-web/src/main/webapp/partial/file.view.html +++ b/docs-web/src/main/webapp/partial/file.view.html @@ -1,4 +1,8 @@
+
+ +
+
diff --git a/docs-web/src/main/webapp/partial/settings.user.edit.html b/docs-web/src/main/webapp/partial/settings.user.edit.html index 5e5c458a..224a858a 100644 --- a/docs-web/src/main/webapp/partial/settings.user.edit.html +++ b/docs-web/src/main/webapp/partial/settings.user.edit.html @@ -54,7 +54,7 @@ -