From 44276dfafd7ffd935233c076fb10d8c3e6f2c51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20N=C3=BCsse?= Date: Sat, 29 Sep 2018 23:08:12 +0200 Subject: [PATCH] Updated Navigationbar to latest styleguide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Felix NĂ¼sse --- js/app/controllers/menu.js | 40 +++++++++++++++++++++++++++++++++++--- sass/admin.scss | 9 --------- sass/app.scss | 1 - sass/menu.scss | 24 ++++++++++++++++------- sass/partials/button.scss | 7 ------- templates/main.php | 38 +++++++++++++++++++++++------------- 6 files changed, 78 insertions(+), 41 deletions(-) diff --git a/js/app/controllers/menu.js b/js/app/controllers/menu.js index f892af38..31165cb7 100644 --- a/js/app/controllers/menu.js +++ b/js/app/controllers/menu.js @@ -77,8 +77,38 @@ $rootScope.$broadcast('selected_tags_updated', $scope.selectedTags); }, 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.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 () { @@ -91,10 +121,14 @@ if ($scope.selectedTags.length === 0) { return TagService.getTags(); } else { - return $scope.filtered_tags; + return TagService.getTags(); + //Always show all tags + //return $scope.filtered_tags; } }, function (tags) { - $scope.available_tags = tags; + //Always show all tags + //$scope.available_tags = tags; + $scope.available_tags = TagService.getTags(); }, true); $scope.toggleDeleteTime = function () { diff --git a/sass/admin.scss b/sass/admin.scss index 8bac6f46..2eae188d 100644 --- a/sass/admin.scss +++ b/sass/admin.scss @@ -12,13 +12,4 @@ #requests-table{ width: 100%; } - - - .link{ - color: rgb(0, 102, 255) !important; - cursor: pointer; - } - .link:hover{ - text-decoration: underline; - } } \ No newline at end of file diff --git a/sass/app.scss b/sass/app.scss index 6ec78345..92f66161 100644 --- a/sass/app.scss +++ b/sass/app.scss @@ -33,7 +33,6 @@ @import 'settings'; #app-settings-content:not(.ng-hide) { - height: 90px; display: inherit !important; padding: 0; transition: height 0.15s ease-out; diff --git a/sass/menu.scss b/sass/menu.scss index 9138c431..a0e952e8 100644 --- a/sass/menu.scss +++ b/sass/menu.scss @@ -23,41 +23,51 @@ .settings-container { div { padding-left: 15px; - + } + button { + width: 80%; + margin-left: 15px; + margin-right: 15px; } } #app-navigation > ul{ - padding-bottom: 80px; > li > a{ - padding-left: 12px !important; z-index: auto; } } .nav-trashbin { - position: fixed !important; - bottom: 44px; + //position: fixed !important; + //bottom: 44px; width: inherit !important; border-right: 1px solid #eee; a { &.active{ - border-left: 3px solid #0082c9; + #border-left: 3px solid #0082c9; } background-color: #fff !important; opacity: 1 !important; z-index: 140; - padding: 0 20px; + //padding: 0 20px; .fa { margin-right: 15px; } } } +//to remove old entry +#taginput{ + visibility: hidden; + display: none; +} + #app-navigation { li{ a.taginput{ + visibility: hidden; + display: none; opacity: 1; } a{ diff --git a/sass/partials/button.scss b/sass/partials/button.scss index 5275fc04..f819ef8f 100644 --- a/sass/partials/button.scss +++ b/sass/partials/button.scss @@ -36,11 +36,4 @@ .button-red:hover{ background: lighten(#ce3702, 2%); color: #fff; -} -.link{ - color: rgb(0, 102, 255) !important; - cursor: pointer; -} -.link:hover{ - text-decoration: underline; } \ No newline at end of file diff --git a/templates/main.php b/templates/main.php index 0e8c79c4..a85ccd66 100644 --- a/templates/main.php +++ b/templates/main.php @@ -125,7 +125,7 @@ style('passman', 'app');
-