Edit document, add files, display files

This commit is contained in:
jendib
2013-07-28 01:07:04 +02:00
parent 9b74bd8194
commit 3a2ffec497
25 changed files with 1811 additions and 421 deletions
@@ -0,0 +1,36 @@
'use strict';
/**
* File view controller.
*/
App.controller('FileView', function($rootScope, $state, $scope, $stateParams) {
$scope.id = $stateParams.fileId;
/**
* Navigate to the next file.
*/
$scope.nextFile = function() {
_.each($rootScope.files, function(value, key, list) {
if (value.id == $scope.id) {
var next = $rootScope.files[key + 1];
if (next) {
$state.transitionTo('document.view.file', { id: $stateParams.id, fileId: next.id });
}
}
});
};
/**
* Navigate to the previous file.
*/
$scope.previousFile = function() {
_.each($rootScope.files, function(value, key, list) {
if (value.id == $scope.id) {
var previous = $rootScope.files[key - 1];
if (previous) {
$state.transitionTo('document.view.file', { id: $stateParams.id, fileId: previous.id });
}
}
});
};
});