mirror of
https://github.com/sismics/docs.git
synced 2025-12-17 19:51:39 +00:00
Document sharing (client), better state handling for file view
This commit is contained in:
7
docs-web/src/main/webapp/app/share/controller/Main.js
Normal file
7
docs-web/src/main/webapp/app/share/controller/Main.js
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Main controller.
|
||||
*/
|
||||
App.controller('Main', function() {
|
||||
});
|
||||
@@ -10,7 +10,7 @@ App.controller('Share', function($scope, $state, $stateParams, Restangular) {
|
||||
$scope.document = data;
|
||||
}, function (response) {
|
||||
if (response.data.status == 403) {
|
||||
// TODO Sharing no more valid
|
||||
$state.transitionTo('403');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -19,4 +19,11 @@ App.controller('Share', function($scope, $state, $stateParams, Restangular) {
|
||||
.then(function (data) {
|
||||
$scope.files = data.files;
|
||||
});
|
||||
|
||||
/**
|
||||
* Navigate to the selected file.
|
||||
*/
|
||||
$scope.openFile = function (file) {
|
||||
$state.transitionTo('share.file', { documentId: $stateParams.documentId, shareId: $stateParams.shareId, fileId: file.id })
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user