From c0a963e845639d7e36002705043710e7493a0ec6 Mon Sep 17 00:00:00 2001 From: jendib Date: Mon, 12 May 2014 21:39:20 +0200 Subject: [PATCH] Button to clear the search field, bug fix on share modal --- docs-parent/TODO | 1 - .../src/app/docs/controller/DocumentModalShare.js | 11 +++++++++++ .../webapp/src/app/docs/controller/DocumentView.js | 7 +------ docs-web/src/main/webapp/src/index.html | 1 + .../src/main/webapp/src/partial/docs/document.html | 6 +++++- 5 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 docs-web/src/main/webapp/src/app/docs/controller/DocumentModalShare.js diff --git a/docs-parent/TODO b/docs-parent/TODO index be42d784..c70fa0df 100644 --- a/docs-parent/TODO +++ b/docs-parent/TODO @@ -1,3 +1,2 @@ - Automatic backup system using Quartz (server) - Handle error while uploading a file (client) -- "X" button next to the search field to clear it (client) \ No newline at end of file diff --git a/docs-web/src/main/webapp/src/app/docs/controller/DocumentModalShare.js b/docs-web/src/main/webapp/src/app/docs/controller/DocumentModalShare.js new file mode 100644 index 00000000..81bff01f --- /dev/null +++ b/docs-web/src/main/webapp/src/app/docs/controller/DocumentModalShare.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Document modal share controller. + */ +angular.module('docs').controller('DocumentModalShare', function ($scope, $modalInstance) { + $scope.name = ''; + $scope.close = function (name) { + $modalInstance.close(name); + } +}); \ No newline at end of file diff --git a/docs-web/src/main/webapp/src/app/docs/controller/DocumentView.js b/docs-web/src/main/webapp/src/app/docs/controller/DocumentView.js index 2a16a47f..a16203ca 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/DocumentView.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/DocumentView.js @@ -92,12 +92,7 @@ angular.module('docs').controller('DocumentView', function ($scope, $state, $sta $scope.share = function () { $modal.open({ templateUrl: 'partial/docs/document.share.html', - controller: function ($scope, $modalInstance) { - $scope.name = ''; - $scope.close = function (name) { - $modalInstance.close(name); - } - } + controller: 'DocumentModalShare' }).result.then(function (name) { if (name == null) { return; diff --git a/docs-web/src/main/webapp/src/index.html b/docs-web/src/main/webapp/src/index.html index c72f0eaa..bd871b5a 100644 --- a/docs-web/src/main/webapp/src/index.html +++ b/docs-web/src/main/webapp/src/index.html @@ -42,6 +42,7 @@ + diff --git a/docs-web/src/main/webapp/src/partial/docs/document.html b/docs-web/src/main/webapp/src/partial/docs/document.html index 0b9d23d0..0bd3a628 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.html @@ -7,7 +7,7 @@
- + + + +