Moved Search from passman-controls to nextcloud-default-searchicon

This commit is contained in:
Felix Nüsse 2018-09-29 20:52:51 +02:00 committed by fnuesse
parent 9f3814320a
commit 677ae51b42
No known key found for this signature in database
GPG key ID: 2089A3431243E819
4 changed files with 29 additions and 16 deletions

View file

@ -33,8 +33,8 @@
*/ */
angular.module('passmanApp') angular.module('passmanApp')
.controller('CredentialCtrl', ['$scope', 'VaultService', 'SettingsService', '$location', 'CredentialService', .controller('CredentialCtrl', ['$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) { 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(); $scope.active_vault = VaultService.getActiveVault();
if (!SettingsService.getSetting('defaultVault') || !SettingsService.getSetting('defaultVaultPass')) { if (!SettingsService.getSetting('defaultVault') || !SettingsService.getSetting('defaultVaultPass')) {
if (!$scope.active_vault) { 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.filtered_credentials = [];
$scope.$watch('[selectedtags, filterOptions, delete_time, active_vault.credentials]', function () { $scope.$watch('[selectedtags, filterOptions, delete_time, active_vault.credentials]', function () {
if (!$scope.active_vault) { if (!$scope.active_vault) {

View file

@ -31,21 +31,11 @@
* Controller of the passmanApp * Controller of the passmanApp
*/ */
angular.module('passmanApp') angular.module('passmanApp')
.controller('MainCtrl', ['$scope', '$rootScope', '$location', 'SettingsService', '$window', '$interval', '$filter', function ($scope, $rootScope, $location, SettingsService, $window, $interval, $filter) { .controller('MainCtrl', ['$scope', '$rootScope', '$location', 'SettingsService', '$window', '$interval', '$filter', function ($scope, $rootScope, $location, SettingsService, $window, $interval, $filter) {
$scope.selectedVault = false; $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; $scope.http_warning_hidden = true;
if ($location.$$protocol === 'http' && $location.$$host !== 'localhost' && $location.$host !== '127.0.0.1') { if ($location.$$protocol === 'http' && $location.$$host !== 'localhost' && $location.$host !== '127.0.0.1') {
$scope.using_http = true; $scope.using_http = true;

View file

@ -113,7 +113,10 @@
} }
.searchboxContainer { .searchboxContainer {
display: inline-block;
/*display: inline-block;*/
visibility: hidden;
display: none;
margin-right: 14px; margin-right: 14px;
float: right; float: right;
.searchbox { .searchbox {

View file

@ -28,7 +28,10 @@
<div class="actions creatable"> <div class="actions creatable">
<span ng-click="addCredential()" class="button new"> <span ng-click="addCredential()" class="button new">
<span >+</span></span>
<!--normal nc add-->
<span class="icon icon-add"></span>
</span>
</div> </div>
<div class="viewModes"> <div class="viewModes">