From 41dda3bb610b3ab49f5e54d725963650f52b0112 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 27 Sep 2017 20:12:19 -0400 Subject: [PATCH] Expand vault all tabs. Search from curr. tab page. --- src/popup/app/config.js | 2 +- src/popup/app/current/currentController.js | 8 ++++++++ src/popup/app/current/views/current.html | 10 ++++++++-- src/popup/app/global/mainController.js | 6 ++++++ src/popup/app/settings/views/settings.html | 3 +++ src/popup/app/tools/views/tools.html | 3 +++ src/popup/app/vault/vaultController.js | 10 ++-------- src/popup/app/vault/views/vault.html | 6 +++--- src/popup/less/components.less | 10 +++++----- 9 files changed, 39 insertions(+), 19 deletions(-) diff --git a/src/popup/app/config.js b/src/popup/app/config.js index 6fc24b0e41..e834cdfa11 100644 --- a/src/popup/app/config.js +++ b/src/popup/app/config.js @@ -112,7 +112,7 @@ url: '/vault', templateUrl: 'app/vault/views/vault.html', controller: 'vaultController', - params: { syncOnLoad: false } + params: { syncOnLoad: false, searchText: null } }) .state('tabs.settings', { url: '/settings', diff --git a/src/popup/app/current/currentController.js b/src/popup/app/current/currentController.js index ed7c19f880..0530cf6ade 100644 --- a/src/popup/app/current/currentController.js +++ b/src/popup/app/current/currentController.js @@ -12,6 +12,8 @@ angular $scope.logins = []; $scope.loaded = false; + $scope.searchText = null; + $('#search').focus(); $scope.$on('$viewContentLoaded', function () { $timeout(loadVault, 100); @@ -101,6 +103,12 @@ angular return login.localData && login.localData.lastUsedDate ? -1 * login.localData.lastUsedDate : 0; }; + $scope.searchVault = function () { + $state.go('tabs.vault', { + searchText: $scope.searchText + }); + }; + $scope.$on('syncCompleted', function (event, successfully) { if ($scope.loaded) { setTimeout(loadVault, 500); diff --git a/src/popup/app/current/views/current.html b/src/popup/app/current/views/current.html index 602ba7a5ec..bd36e3d22d 100644 --- a/src/popup/app/current/views/current.html +++ b/src/popup/app/current/views/current.html @@ -1,8 +1,14 @@ -
+
diff --git a/src/popup/app/global/mainController.js b/src/popup/app/global/mainController.js index 15f76efe74..3a19c94925 100644 --- a/src/popup/app/global/mainController.js +++ b/src/popup/app/global/mainController.js @@ -9,6 +9,7 @@ angular self.xsBody = $window.screen.availHeight < 600; self.smBody = !self.xsBody && $window.screen.availHeight <= 800; self.lgBody = !self.xsBody && !self.smBody && utilsService && !utilsService.isFirefox() && !utilsService.isEdge(); + self.disableSearch = utilsService.isEdge(); $scope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) { if (toParams.animation) { @@ -20,6 +21,11 @@ angular } }); + self.expandVault = function (e) { + $analytics.eventTrack('Expand Vault'); + chrome.tabs.create({ url: $window.location.href }); + }; + chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) { if (msg.command === 'syncCompleted') { $scope.$broadcast('syncCompleted', msg.successfully); diff --git a/src/popup/app/settings/views/settings.html b/src/popup/app/settings/views/settings.html index afa7c78705..2ebd1f094a 100644 --- a/src/popup/app/settings/views/settings.html +++ b/src/popup/app/settings/views/settings.html @@ -1,4 +1,7 @@ 
+
+ +
{{i18n.settings}}
diff --git a/src/popup/app/tools/views/tools.html b/src/popup/app/tools/views/tools.html index 181635d8e1..291fa22cd3 100644 --- a/src/popup/app/tools/views/tools.html +++ b/src/popup/app/tools/views/tools.html @@ -1,4 +1,7 @@ 
+
+ +
{{i18n.tools}}
diff --git a/src/popup/app/vault/vaultController.js b/src/popup/app/vault/vaultController.js index b488271e01..8142ace3fa 100644 --- a/src/popup/app/vault/vaultController.js +++ b/src/popup/app/vault/vaultController.js @@ -9,7 +9,6 @@ $scope.i18n = i18nService; $scope.showFolderCounts = !utilsService.isEdge(); $scope.showOnlyFolderView = utilsService.isEdge(); - $scope.disableSearch = utilsService.isEdge(); $('#search').focus(); var syncOnLoad = $stateParams.syncOnLoad; @@ -84,8 +83,8 @@ } $scope.searchText = null; - if (state.searchText) { - $scope.searchText = state.searchText; + if (state.searchText || $stateParams.searchText) { + $scope.searchText = state.searchText || $stateParams.searchText; } $scope.folderSort = function (item) { @@ -158,11 +157,6 @@ $timeout(loadVault, 500); }); - $scope.expandVault = function (e) { - $analytics.eventTrack('Expand Vault'); - chrome.tabs.create({ url: '/popup/index.html#!/tab/vault' }); - }; - function storeState() { stateService.saveState(stateKey, { scrollY: getScrollY(), diff --git a/src/popup/app/vault/views/vault.html b/src/popup/app/vault/views/vault.html index ea46423b46..640ad54162 100644 --- a/src/popup/app/vault/views/vault.html +++ b/src/popup/app/vault/views/vault.html @@ -1,9 +1,9 @@