diff --git a/js/app/controllers/credential.js b/js/app/controllers/credential.js index 303635f1..e6ffe575 100644 --- a/js/app/controllers/credential.js +++ b/js/app/controllers/credential.js @@ -33,8 +33,8 @@ */ angular.module('passmanApp') .controller('CredentialCtrl', ['$scope', 'VaultService', 'SettingsService', '$location', 'CredentialService', - '$rootScope', 'FileService', 'EncryptService', 'TagService', '$timeout', 'NotificationService', 'CacheService', 'ShareService', 'SharingACL', '$interval', '$filter', '$routeParams', '$sce', '$translate', - function ($scope, VaultService, SettingsService, $location, CredentialService, $rootScope, FileService, EncryptService, TagService, $timeout, NotificationService, CacheService, ShareService, SharingACL, $interval, $filter, $routeParams, $sce, $translate) { + '$rootScope', 'FileService', 'EncryptService', 'TagService', '$timeout', 'NotificationService', 'CacheService', 'ShareService', 'SharingACL', '$interval', '$filter', '$routeParams', '$sce', '$translate','$compile', + function ($scope, VaultService, SettingsService, $location, CredentialService, $rootScope, FileService, EncryptService, TagService, $timeout, NotificationService, CacheService, ShareService, SharingACL, $interval, $filter, $routeParams, $sce, $translate, $compile) { $scope.active_vault = VaultService.getActiveVault(); if (!SettingsService.getSetting('defaultVault') || !SettingsService.getSetting('defaultVaultPass')) { if (!$scope.active_vault) { @@ -326,6 +326,23 @@ }; + + //searchboxfix + var native_search = document.getElementById("searchbox"); + native_search.classList.remove('hidden'); + native_search.addEventListener('keypress', function (e) { + if(e.keyCode == 13){ + e.preventDefault(); + } + }); + + native_search.addEventListener('keyup', function (e) { + console.log("keyup"); + $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/main.js b/js/app/controllers/main.js index 29fa5d3e..bce529ca 100644 --- a/js/app/controllers/main.js +++ b/js/app/controllers/main.js @@ -31,21 +31,11 @@ * Controller of the passmanApp */ angular.module('passmanApp') + + .controller('MainCtrl', ['$scope', '$rootScope', '$location', 'SettingsService', '$window', '$interval', '$filter', function ($scope, $rootScope, $location, SettingsService, $window, $interval, $filter) { $scope.selectedVault = false; - - var native_search = document.getElementById("searchbox"); - var old_search = document.getElementById("searchBox"); - - native_search.classList.remove('hidden'); - native_search.classList.add('searchbox','ng-valid','ng-touched','ng-dirty','ng-valid-parse','ng-empty'); - native_search.setAttribute("ng-model","filterOptions.filterText"); - - native_search.addEventListener("change", function(){ - old_search.value=native_search.innerText; - }); - $scope.http_warning_hidden = true; if ($location.$$protocol === 'http' && $location.$$host !== 'localhost' && $location.$host !== '127.0.0.1') { $scope.using_http = true; diff --git a/sass/credentials.scss b/sass/credentials.scss index 4f471002..8b07a1ec 100644 --- a/sass/credentials.scss +++ b/sass/credentials.scss @@ -113,7 +113,10 @@ } .searchboxContainer { - display: inline-block; + + /*display: inline-block;*/ + visibility: hidden; + display: none; margin-right: 14px; float: right; .searchbox { diff --git a/templates/views/show_vault.html b/templates/views/show_vault.html index 88848688..30fbc62f 100644 --- a/templates/views/show_vault.html +++ b/templates/views/show_vault.html @@ -28,7 +28,10 @@
- + + + + +