Added view site option to current tab listing

This commit is contained in:
Kyle Spearrin 2016-11-09 21:45:29 -05:00
parent 64abacf180
commit c9413a5c49
6 changed files with 38 additions and 10 deletions

View File

@ -93,7 +93,7 @@
templateUrl: 'app/vault/views/vaultViewSite.html',
controller: 'vaultViewSiteController',
data: { authorize: true },
params: { animation: null, returnScrollY: 0, returnSearchText: null }
params: { animation: null, returnScrollY: 0, returnSearchText: null, fromCurrent: false }
})
.state('addSite', {
url: '/add-site',
@ -110,7 +110,10 @@
templateUrl: 'app/vault/views/vaultEditSite.html',
controller: 'vaultEditSiteController',
data: { authorize: true },
params: { animation: null, fromView: true, returnScrollY: 0, returnSearchText: null, site: null }
params: {
animation: null, fromView: true, returnScrollY: 0,
returnSearchText: null, site: null, fromCurrent: false
}
})
.state('passwordGenerator', {

View File

@ -92,6 +92,16 @@ angular
}
};
$scope.viewSite = function (site, e) {
e.stopPropagation();
$state.go('viewSite', {
siteId: site.id,
animation: 'in-slide-up',
fromCurrent: true
});
};
$scope.$on('syncCompleted', function (event, successfully) {
if ($scope.loaded) {
setTimeout(loadVault, 500);

View File

@ -22,6 +22,10 @@
data-clipboard-text="{{site.username}}" ng-class="{'disabled': !site.username}">
<i class="fa fa-lg fa-user"></i>
</span>
<span class="btn-list" href="" ng-click="viewSite(site, $event) && $event.stopPropagation()"
title="{{i18n.edit}} {{site.name}}">
<i class="fa fa-lg fa-pencil"></i>
</span>
<span class="text">{{site.name}}</span>
<span class="detail">{{site.username}}</span>
</a>

View File

@ -8,6 +8,7 @@ angular
var returnSearchText = $stateParams.returnSearchText;
var siteId = $stateParams.siteId;
var fromView = $stateParams.fromView;
var fromCurrent = $stateParams.fromCurrent;
$scope.site = {
folderId: null
@ -73,7 +74,8 @@ angular
siteId: siteId,
animation: 'out-slide-down',
returnScrollY: returnScrollY || 0,
returnSearchText: returnSearchText
returnSearchText: returnSearchText,
fromCurrent: fromCurrent
});
}
else {

View File

@ -6,6 +6,7 @@ angular
$scope.i18n = i18nService;
var returnScrollY = $stateParams.returnScrollY;
var returnSearchText = $stateParams.returnSearchText;
var fromCurrent = $stateParams.fromCurrent;
$scope.site = null;
siteService.get($stateParams.siteId, function (site) {
@ -47,16 +48,24 @@ angular
siteId: site.id,
fromView: true,
returnScrollY: returnScrollY || 0,
returnSearchText: returnSearchText
returnSearchText: returnSearchText,
fromCurrent: fromCurrent
});
};
$scope.close = function () {
if (fromCurrent) {
$state.go('tabs.current', {
animation: 'out-slide-down'
});
}
else {
$state.go('tabs.vault', {
animation: 'out-slide-down',
scrollY: returnScrollY || 0,
searchText: returnSearchText
});
}
};
$scope.launchWebsite = function (site) {

View File

@ -32,7 +32,7 @@
<i class="fa fa-lg fa-clipboard"></i>
</a>
<span class="item-label">{{i18n.username}}</span>
<span id="username" class="monospaced">{{site.username}}</span>
<span id="username">{{site.username}}</span>
</div>
<div class="list-section-item" ng-if="site.password">
<a class="btn-list" href="" title="{{i18n.copyPassword}}" ngclipboard ngclipboard-error="clipboardError(e)"