mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 05:57:57 +01:00
Close button on file preview
This commit is contained in:
parent
2fa2d32873
commit
10b31aec29
@ -1 +0,0 @@
|
||||
- Close button on file preview
|
@ -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 });
|
||||
|
@ -1,4 +1,8 @@
|
||||
<div class="text-center">
|
||||
<div class="btn-group pull-left">
|
||||
<button type="button" class="btn" ng-click="closeFile()"><span class="icon-remove"></span></button>
|
||||
</div>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn" ng-click="previousFile()">Previous</button>
|
||||
<button type="button" class="btn" ng-click="nextFile()">Next</button>
|
||||
|
@ -54,7 +54,7 @@
|
||||
<button type="submit" class="btn btn-primary" ng-click="edit()" ng-disabled="!editUserForm.$valid">
|
||||
<span class="icon-pencil icon-white"></span> {{ isEdit() ? 'Edit' : 'Add' }}
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger" ng-click="remove()">
|
||||
<button type="button" class="btn btn-danger" ng-click="remove()" ng-show="isEdit()">
|
||||
<span class="icon-trash icon-white"></span> Delete
|
||||
</button>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user