mirror of
https://github.com/sismics/docs.git
synced 2024-11-21 21:47:57 +01:00
Closes #334: highlight previously opened file
This commit is contained in:
parent
3b5c27096b
commit
82737e2280
@ -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();
|
||||
|
@ -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 });
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -161,7 +161,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ui-sortable="fileSortableOptions" ng-model="files">
|
||||
<tr ng-repeat="file in files">
|
||||
<tr ng-repeat="file in files" ng-class="{ 'active': openedFile.id == file.id }">
|
||||
<td class="pointer" ng-click="openFile(file, $event)">
|
||||
<div class="thumbnail-list">
|
||||
<img ng-src="../api/file/{{ file.id }}/data?size=thumb" />
|
||||
|
Loading…
Reference in New Issue
Block a user