File
Methods
Async
addBookmark
|
addBookmark()
|
Returns : Promise<void>
|
Async
editBookmarks
|
editBookmarks()
|
Returns : Promise<void>
|
Async
ngOnInit
|
ngOnInit()
|
Returns : Promise<void>
|
openUrl
|
openUrl(url: string)
|
Parameters :
Name |
Type |
Optional |
url |
string
|
No
|
|
addButtonText
|
Default value : this.translateService.instant(gettext('Add current page'))
|
drawerOpen$
|
Type : Observable<boolean>
|
emptyMessageBody
|
Default value : this.translateService.instant(
gettext(
'Navigate to the desired page and click the "Add current page" button. Editing, deleting and reordering are possible by clicking on the cog wheel.'
)
)
|
emptyMessageHeader
|
Default value : this.translateService.instant(gettext('No bookmarks yet'))
|
<div class="separator-top p-t-8 m-t-auto c8y-right-drawer__item sticky-top">
<i c8yIcon="bookmark"></i>
<span class="text-bold">{{ 'Bookmarks' | translate }}</span>
<button
class="btn-dot m-l-auto"
tooltip="{{ 'Edit bookmarks' | translate }}"
[attr.aria-label]="'Edit bookmarks' | translate"
container="body"
placement="left"
[adaptivePosition]="false"
[delay]="500"
(click)="editBookmarks()"
type="button"
[tabindex]="(drawerOpen$ | async) ? '0' : '-1'"
>
<i c8yIcon="cog" class="text-14 m-0"></i>
</button>
</div>
<div class="c8y-right-drawer__item p-t-0 p-b-8" *ngIf="bookmarks?.length">
<button
class="btn btn-default btn-sm"
(click)="addBookmark()"
type="button"
[tabindex]="(drawerOpen$ | async) ? '0' : '-1'"
>
<i c8yIcon="plus-circle-o" class="m-t-0 m-b-0 text-14"></i>
<span>{{ addButtonText }}</span>
</button>
</div>
<ng-container *ngFor="let bookmark of bookmarks">
<button
title="{{ bookmark.label }}"
type="button"
class="c8y-right-drawer__link"
(click)="openUrl(bookmark.url)"
[tabindex]="(drawerOpen$ | async) ? '0' : '-1'"
>
<i [c8yIcon]="bookmark.icon" *ngIf="bookmark.icon"></i>
<span class="text-truncate">{{ bookmark.label }}</span>
</button>
</ng-container>
<div class="p-t-8 p-b-8">
<ng-container *ngIf="!bookmarks?.length">
<span class="c8y-right-drawer__item text-muted text-bold text-14 p-b-0">
{{ emptyMessageHeader }}
</span>
<span class="c8y-right-drawer__item text-12 p-t-0">
<span class="text-muted">{{ emptyMessageBody }}</span>
</span>
<div class="c8y-right-drawer__item">
<button
class="btn btn-default btn-sm"
(click)="addBookmark()"
type="button"
[tabindex]="(drawerOpen$ | async) ? '0' : '-1'"
>
<i c8yIcon="plus-circle-o" class="m-t-0 m-b-0 text-14"></i>
<span>{{ addButtonText }}</span>
</button>
</div>
</ng-container>
</div>