Updated Navigationbar to latest styleguide

Signed-off-by: Felix Nüsse <Felix.nuesse@t-online.de>
This commit is contained in:
Felix Nüsse 2018-09-29 23:08:12 +02:00
parent b9d72657d1
commit f1e33d0254
6 changed files with 78 additions and 41 deletions

View file

@ -77,8 +77,38 @@
$rootScope.$broadcast('selected_tags_updated', $scope.selectedTags); $rootScope.$broadcast('selected_tags_updated', $scope.selectedTags);
}, true); }, true);
$scope.tagSelected = function (tag) {
for (var i = 0; i < $scope.selectedTags.length; i++) {
if($scope.selectedTags[i].text === tag.text){
return true;
}
}
return false;
};
$scope.removeTagFromSelected = function (tag) {
var where =-1;
for (var i = 0; i < $scope.selectedTags.length; i++) {
if($scope.selectedTags[i].text === tag.text){
where=i;
}
}
if(where === -1){
console.log("Cant remove selected Tag, Tag not present!");
}else{
}
$scope.selectedTags.splice(where, 1);
};
$scope.tagClicked = function (tag) { $scope.tagClicked = function (tag) {
$scope.selectedTags.push(tag); //check if tag already selected
if(!$scope.tagSelected(tag)){
$scope.selectedTags.push(tag);
}else{
//console.log("Already selected Tag!");
$scope.removeTagFromSelected(tag);
}
}; };
$rootScope.$on('credentials_loaded', function () { $rootScope.$on('credentials_loaded', function () {
@ -91,10 +121,14 @@
if ($scope.selectedTags.length === 0) { if ($scope.selectedTags.length === 0) {
return TagService.getTags(); return TagService.getTags();
} else { } else {
return $scope.filtered_tags; return TagService.getTags();
//Always show all tags
//return $scope.filtered_tags;
} }
}, function (tags) { }, function (tags) {
$scope.available_tags = tags; //Always show all tags
//$scope.available_tags = tags;
$scope.available_tags = TagService.getTags();
}, true); }, true);
$scope.toggleDeleteTime = function () { $scope.toggleDeleteTime = function () {

View file

@ -12,13 +12,4 @@
#requests-table{ #requests-table{
width: 100%; width: 100%;
} }
.link{
color: rgb(0, 102, 255) !important;
cursor: pointer;
}
.link:hover{
text-decoration: underline;
}
} }

View file

@ -33,7 +33,6 @@
@import 'settings'; @import 'settings';
#app-settings-content:not(.ng-hide) { #app-settings-content:not(.ng-hide) {
height: 90px;
display: inherit !important; display: inherit !important;
padding: 0; padding: 0;
transition: height 0.15s ease-out; transition: height 0.15s ease-out;

View file

@ -23,41 +23,51 @@
.settings-container { .settings-container {
div { div {
padding-left: 15px; padding-left: 15px;
}
button {
width: 80%;
margin-left: 15px;
margin-right: 15px;
} }
} }
#app-navigation > ul{ #app-navigation > ul{
padding-bottom: 80px;
> li > a{ > li > a{
padding-left: 12px !important;
z-index: auto; z-index: auto;
} }
} }
.nav-trashbin { .nav-trashbin {
position: fixed !important; //position: fixed !important;
bottom: 44px; //bottom: 44px;
width: inherit !important; width: inherit !important;
border-right: 1px solid #eee; border-right: 1px solid #eee;
a { a {
&.active{ &.active{
border-left: 3px solid #0082c9; #border-left: 3px solid #0082c9;
} }
background-color: #fff !important; background-color: #fff !important;
opacity: 1 !important; opacity: 1 !important;
z-index: 140; z-index: 140;
padding: 0 20px; //padding: 0 20px;
.fa { .fa {
margin-right: 15px; margin-right: 15px;
} }
} }
} }
//to remove old entry
#taginput{
visibility: hidden;
display: none;
}
#app-navigation { #app-navigation {
li{ li{
a.taginput{ a.taginput{
visibility: hidden;
display: none;
opacity: 1; opacity: 1;
} }
a{ a{

View file

@ -36,11 +36,4 @@
.button-red:hover{ .button-red:hover{
background: lighten(#ce3702, 2%); background: lighten(#ce3702, 2%);
color: #fff; color: #fff;
}
.link{
color: rgb(0, 102, 255) !important;
cursor: pointer;
}
.link:hover{
text-decoration: underline;
} }

View file

@ -125,7 +125,7 @@ style('passman', 'app');
</div> </div>
<div id="app-navigation" ng-show="selectedVault" ng-controller="MenuCtrl"> <div id="app-navigation" ng-show="selectedVault" ng-controller="MenuCtrl">
<ul> <ul class="with-icon">
<li class="taginput"> <li class="taginput">
<a class="taginput"> <a class="taginput">
<tags-input ng-model="selectedTags" replace-spaces-with-dashes="false"> <tags-input ng-model="selectedTags" replace-spaces-with-dashes="false">
@ -134,16 +134,20 @@ style('passman', 'app');
</a> </a>
</li> </li>
<li ng-repeat="tag in available_tags | orderBy:'text'" ng-if="selectedTags.indexOf(tag) == -1">
<a class="nav-icon-systemtagsfilter svg" ng-click="tagClicked(tag)">{{tag.text}}</a>
<li ng-repeat="tag in available_tags | orderBy:'text'" ng-class="{'active': tagSelected(tag)}">
<a class="icon-tag svg" ng-click="tagClicked(tag)" ng-class="{'icon-toggle': tagSelected(tag)}">{{tag.text}}</a>
</li> </li>
<li data-id="trashbin" class="nav-trashbin"> <li data-id="trashbin" class="nav-trashbin pinned first-pinned">
<a ng-click="toggleDeleteTime()" <a href="#" ng-click="toggleDeleteTime()" ng-class="{'active': delete_time > 0}" class="icon-delete svg">
ng-class="{'active': delete_time > 0}">
<i href="#" class="fa fa-trash"></i>
{{ 'deleted.credentials' | translate }} {{ 'deleted.credentials' | translate }}
</a> </a>
</li> </li>
</ul> </ul>
<div id="app-settings" ng-init="settingsShown = false;"> <div id="app-settings" ng-init="settingsShown = false;">
@ -154,15 +158,21 @@ style('passman', 'app');
</button> </button>
</div> </div>
<div id="app-settings-content" ng-show="settingsShown"> <div id="app-settings-content" ng-show="settingsShown">
<!-- Your settings in here -->
<div class="settings-container"> <div class="settings-container">
<div><a class="link" ng-href="#/vault/{{active_vault.guid}}/settings">{{ 'settings' | translate }}</a></div> <button ng-href="#/vault/{{active_vault.guid}}/settings"><a class="link" >{{ 'settings' | translate }}</a></button>
<div><span class="link" ng-click="logout()">{{'logout' | translate }}</span></div>
<div><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6YS8F97PETVU2" target="_blank" class="link">{{ 'donate' | translate }}</a></div>
<div ng-show="session_time_left">
<small>{{'session.time.left' | translate:translationData}}</small>
</div>
</div> </div>
<div class="settings-container">
<button ng-click="logout()"><span class="link" >{{'logout' | translate }}</span></button>
</div>
<div class="donation-container settings-container">
<button class="donation-container"> <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6YS8F97PETVU2" target="_blank" class="link">{{ 'donate' | translate }}</a></button>
</div>
<div class="settings-container">
<div ng-show="session_time_left">
<small>{{'session.time.left' | translate:translationData}}</small>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>