Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/passman.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorfnuesse <felix.nuesse@t-online.de>2018-11-14 22:54:10 +0300
committerfnuesse <felix.nuesse@t-online.de>2018-11-21 19:34:41 +0300
commit2dd6adb2b43a385d324e508ff55193899e05c2ea (patch)
tree26a9d782623923c534b7022441acc6d81986ebd0 /js
parentc109bad869496fb06ebe1559d4601fd546842ddc (diff)
Refactored Searchbox to menu.js
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Diffstat (limited to 'js')
-rw-r--r--js/app/controllers/credential.js27
-rw-r--r--js/app/controllers/menu.js24
2 files changed, 28 insertions, 23 deletions
diff --git a/js/app/controllers/credential.js b/js/app/controllers/credential.js
index b4a2929e..42ecb2dd 100644
--- a/js/app/controllers/credential.js
+++ b/js/app/controllers/credential.js
@@ -325,31 +325,12 @@
fields: ['label', 'username', 'email', 'custom_fields']
};
+ //searchboxfix
+ $scope.$on('nc_searchbox', function(event, args) {
+ $scope.filterOptions.filterText=args;
+ });
- //searchboxfix
- var native_search = document.getElementById("searchbox");
- if(native_search !== null){
- native_search.nextElementSibling.addEventListener('click', function (e) {
- $scope.$apply(function () {
- $scope.filterOptions.filterText="";
- });
- });
-
- native_search.classList.remove('hidden');
- native_search.addEventListener('keypress', function (e) {
- if(e.keyCode === 13){
- e.preventDefault();
- }
- });
-
- native_search.addEventListener('keyup', function (e) {
- $scope.$apply(function () {
- $scope.filterOptions.filterText=native_search.value;
- });
- });
- }
-
$scope.filtered_credentials = [];
$scope.$watch('[selectedtags, filterOptions, delete_time, active_vault.credentials]', function () {
if (!$scope.active_vault) {
diff --git a/js/app/controllers/menu.js b/js/app/controllers/menu.js
index 9047c64b..6058b39d 100644
--- a/js/app/controllers/menu.js
+++ b/js/app/controllers/menu.js
@@ -118,6 +118,30 @@
}
};
+ //searchboxfix
+ var native_search = document.getElementById("searchbox");
+ if(native_search !== null){
+ native_search.nextElementSibling.addEventListener('click', function (e) {
+ $scope.$apply(function () {
+ $rootScope.$broadcast('nc_searchbox',"");
+ });
+ });
+
+ native_search.classList.remove('hidden');
+ native_search.addEventListener('keypress', function (e) {
+ if(e.keyCode === 13){
+ e.preventDefault();
+ }
+ });
+
+ native_search.addEventListener('keyup', function (e) {
+ $scope.$apply(function () {
+ $rootScope.$broadcast('nc_searchbox',native_search.value);
+ });
+ });
+ }
+
+
$scope.clickedNavigationItem="all";
$scope.filterCredentialBySpecial = function (string) {
$scope.clickedNavigationItem=string;