1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-20 11:25:37 +01:00

refactored out main. props to each ctrl.

This commit is contained in:
Kyle Spearrin 2017-11-14 10:10:13 -05:00
parent 947e51f3b5
commit b9139eec33
5 changed files with 7 additions and 6 deletions

View File

@ -14,6 +14,8 @@ angular
$scope.otherCiphers = [];
$scope.loaded = false;
$scope.searchText = null;
$scope.inSidebar = utilsService.inSidebar($window);
$scope.disableSearch = utilsService.isEdge();
document.getElementById('search').focus();
$scope.$on('$viewContentLoaded', function () {

View File

@ -1,11 +1,11 @@
<div class="header header-search">
<div class="left" ng-if="!main.inSidebar">
<div class="left" ng-if="!inSidebar">
<pop-out></pop-out>
</div>
<div class="left" ng-if="main.inSidebar">
<div class="left" ng-if="inSidebar">
<a href="" ng-click="refresh()"><i class="fa fa-refresh fa-lg"></i></a>
</div>
<div class="search" ng-style="{'visibility': main.disableSearch ? 'hidden' : 'visible'}">
<div class="search" ng-style="{'visibility': disableSearch ? 'hidden' : 'visible'}">
<input type="search" placeholder="{{i18n.searchVault}}" id="search" ng-model="searchText" ng-change="searchVault()" />
<i class="fa fa-search"></i>
</div>

View File

@ -7,8 +7,6 @@ angular
self.animation = '';
self.xsBody = $window.screen.availHeight < 600;
self.smBody = !self.xsBody && $window.screen.availHeight <= 800;
self.disableSearch = utilsService && utilsService.isEdge();
self.inSidebar = utilsService && utilsService.inSidebar($window);
$transitions.onSuccess({}, function(transition) {
const toParams = transition.params("to");

View File

@ -9,6 +9,7 @@ angular
$scope.i18n = i18nService;
$scope.showFolderCounts = !utilsService.isEdge();
$scope.showOnlyFolderView = utilsService.isEdge();
$scope.disableSearch = utilsService.isEdge();
document.getElementById('search').focus();
var syncOnLoad = $stateParams.syncOnLoad;

View File

@ -2,7 +2,7 @@
<div class="left">
<pop-out></pop-out>
</div>
<div class="search" ng-style="{'visibility': main.disableSearch ? 'hidden' : 'visible'}">
<div class="search" ng-style="{'visibility': disableSearch ? 'hidden' : 'visible'}">
<input type="search" placeholder="{{::i18n.searchVault}}" id="search" ng-model="searchText" />
<i class="fa fa-search"></i>
</div>