Skip to content

Commit df08200

Browse files
committed
update bookmarks history when using quick history access
1 parent 329f41e commit df08200

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

frontend/src/app/app.component.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
title="History"
5151
[routerLink]="['/history']"
5252
>
53-
<i class="fas fa-history mr-1"></i> Last visited:
53+
<i class="fas fa-history mr-1"></i> History bookmarks:
5454
</a>
5555
<div *ngIf="(latestVisitedBookmarks$ | async) as latestVisitedBookmarks" class="mt-1" (mouseout)="resetHoveringLastVisited()">
5656
<ng-container *ngFor="let bookmark of latestVisitedBookmarks; let i = index" class="mt-1">
@@ -63,6 +63,8 @@
6363
[class.public-bookmarks-last-search]="bookmark.public === true"
6464
href="{{bookmark.location}}}"
6565
title="Go to {{bookmark.name}}"
66+
(click)="addToHistoryService.promoteInHistoryIfLoggedIn(userIsLoggedIn, bookmark)"
67+
(auxclick)="addToHistoryService.promoteInHistoryIfLoggedIn(userIsLoggedIn, bookmark)"
6668
target="_blank">
6769
<i class="fa fa-xs fa-bookmark mr-1"></i>
6870
<span
@@ -91,12 +93,17 @@
9193
title="{{'Search in ' + mySearch.searchDomain + ': ' + mySearch.text}}"
9294
> <i class="fa fa-xs fa-search mr-1"></i>
9395
<span
94-
*ngIf="!hoveringLastSearches[i]; else longVersion">{{mySearch.text.length > 20 ? mySearch.text.substring(0, 20) + '...' : mySearch.text}}</span>
96+
*ngIf="!hoveringLastSearches[i]; else longVersion">{{mySearch.text.length > 30 ? mySearch.text.substring(0, 30) + '...' : mySearch.text}}</span>
9597
<ng-template #longVersion>{{mySearch.text}}</ng-template>
9698
<i *ngIf="mySearch.searchDomain === 'my-snippets' || mySearch.searchDomain === 'public-snippets'"
9799
class="fa fa-xs fa-code ml-1"></i>
98100
<i *ngIf="mySearch.searchDomain === 'my-bookmarks' || mySearch.searchDomain === 'public-bookmarks'"
99101
class="fa fa-xs fa-bookmark ml-1"></i>
102+
<span *ngIf="mySearch.searchDomain === 'all-mine'">
103+
<i class="fa fa-xs fa-bookmark ml-1"></i>
104+
<i class="fa fa-xs fa-code ml-1"></i>
105+
</span>
106+
100107
</a>
101108
</span>
102109
</ng-container>

frontend/src/app/app.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { Search, UserData } from './core/model/user-data';
1717
import { Observable } from 'rxjs';
1818
import { map } from 'rxjs/operators';
1919
import { Bookmark } from './core/model/bookmark';
20+
import { AddToHistoryService } from './core/user/add-to-history.service';
2021

2122
@Component({
2223
selector: 'app-root',
@@ -47,7 +48,8 @@ export class AppComponent implements OnInit {
4748
private historyDialog: MatDialog,
4849
private loginDialog: MatDialog,
4950
private cookieService: CookieService,
50-
private feedbackService: FeedbackService) {
51+
private feedbackService: FeedbackService,
52+
private addToHistoryService: AddToHistoryService) {
5153
this.innerWidth = 100;
5254
}
5355

0 commit comments

Comments
 (0)