styling context menu
This commit is contained in:
parent
7d4e4e90c6
commit
3f8df79f33
|
@ -27,19 +27,19 @@
|
||||||
<fa-icon [icon]="faWindowCloseRegular"></fa-icon>
|
<fa-icon [icon]="faWindowCloseRegular"></fa-icon>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<!-- <a href class="action-bar__link action-bar__link--more" (click)="return false;" title="More" [contextMenu]="basicMenu" [contextMenuSubject]="item"> -->
|
<a href class="action-bar__link action-bar__link--more" (click)="onContextMenu($event, item)" title="More" [contextMenu]="basicMenu" [contextMenuSubject]="item">
|
||||||
<fa-icon [icon]="faEllipsisH" [contextMenu]="basicMenu" [contextMenuSubject]="item"></fa-icon>
|
<fa-icon [icon]="faEllipsisH" [contextMenu]="basicMenu" [contextMenuSubject]="item" ></fa-icon>
|
||||||
<!-- </a> -->
|
</a>
|
||||||
<context-menu #basicMenu>
|
<context-menu #basicMenu>
|
||||||
<ng-template contextMenuItem (execute)="showMessage('Hi, ' + $event.item.name)">
|
<ng-template contextMenuItem (execute)="showMessage('Hi, ' + $event.item.name)">
|
||||||
Say hi!
|
Say hi!
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<ng-template contextMenuItem divider="true"></ng-template>
|
<!-- <ng-template contextMenuItem divider="true"></ng-template> -->
|
||||||
<ng-template contextMenuItem let-item (execute)="showMessage($event.item.name + ' said: ' + $event.item.otherProperty)">
|
<ng-template contextMenuItem let-item (execute)="showMessage($event.item.name + ' said: ' + $event.item.otherProperty)">
|
||||||
Bye, {{item?.name}}
|
Bye, {{item?.name}}
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<ng-template contextMenuItem passive="true">
|
<!-- <ng-template contextMenuItem passive="true">
|
||||||
Input something: <input type="text">
|
Input something: <input type="text">
|
||||||
</ng-template>
|
</ng-template> -->
|
||||||
</context-menu>
|
</context-menu>
|
||||||
</div>
|
</div>
|
|
@ -1,8 +1,9 @@
|
||||||
@import "variables";
|
@import "variables";
|
||||||
|
@import "context-menu";
|
||||||
|
|
||||||
.action-bar {
|
.action-bar {
|
||||||
// outline: 1px solid greenyellow; // height: 20px;
|
// outline: 1px solid greenyellow; // height: 20px;
|
||||||
margin: 5px 10px 5px $avatar-column-space;
|
margin: 5px 0px 5px $avatar-column-space;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
@ -41,14 +42,12 @@
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--more {
|
||||||
|
position: absolute;
|
||||||
|
right: -5px;
|
||||||
// &--more {
|
// left: 155px;
|
||||||
// position: absolute;
|
bottom: -2px;
|
||||||
// left: 155px;
|
}
|
||||||
// bottom: -6px;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&__lock {
|
&__lock {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { ToolsService } from '../../../../services/tools.service';
|
||||||
import { NotificationService } from '../../../../services/notification.service';
|
import { NotificationService } from '../../../../services/notification.service';
|
||||||
import { StatusWrapper } from '../../../../models/common.model';
|
import { StatusWrapper } from '../../../../models/common.model';
|
||||||
|
|
||||||
import { ContextMenuComponent } from 'ngx-contextmenu';
|
import { ContextMenuComponent, ContextMenuService } from 'ngx-contextmenu';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-action-bar',
|
selector: 'app-action-bar',
|
||||||
|
@ -59,6 +59,7 @@ export class ActionBarComponent implements OnInit, OnDestroy {
|
||||||
private accountSub: Subscription;
|
private accountSub: Subscription;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
private contextMenuService: ContextMenuService,
|
||||||
private readonly store: Store,
|
private readonly store: Store,
|
||||||
private readonly toolsService: ToolsService,
|
private readonly toolsService: ToolsService,
|
||||||
private readonly mastodonService: MastodonService,
|
private readonly mastodonService: MastodonService,
|
||||||
|
@ -220,4 +221,15 @@ export class ActionBarComponent implements OnInit, OnDestroy {
|
||||||
console.warn('more'); //TODO
|
console.warn('more'); //TODO
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public onContextMenu($event: MouseEvent, item: any): void {
|
||||||
|
this.contextMenuService.show.next({
|
||||||
|
// Optional - if unspecified, all context menu components will open
|
||||||
|
contextMenu: this.basicMenu,
|
||||||
|
event: $event,
|
||||||
|
item: item,
|
||||||
|
});
|
||||||
|
$event.preventDefault();
|
||||||
|
$event.stopPropagation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> -->
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.lds-ripple {
|
.lds-ripple {
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
@import "variables";
|
||||||
|
::ng-deep .ngx-contextmenu {
|
||||||
|
transition: all .4s;
|
||||||
|
border-radius: 3px;
|
||||||
|
|
||||||
|
& .dropdown-menu {
|
||||||
|
border: solid 1px $context-menu-border-color;
|
||||||
|
background-color: $context-menu-border-color;
|
||||||
|
background-color: $context-menu-background;
|
||||||
|
padding: 0;
|
||||||
|
border: solid 2px $context-menu-border-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
& li {
|
||||||
|
display: block;
|
||||||
|
// border-top: solid 1px $context-menu-border-color;
|
||||||
|
// text-transform: uppercase;
|
||||||
|
// text-align: center;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
border-top: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& a {
|
||||||
|
color: $btn-primary-font-color;
|
||||||
|
display: block;
|
||||||
|
padding: 0.5em 1em;
|
||||||
|
padding: 5px 10px;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: $btn-primary-font-color;
|
||||||
|
background-color: $context-menu-background-hover;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -52,4 +52,17 @@ $button-border-color: #303957;
|
||||||
|
|
||||||
$column-background: #0f111a;
|
$column-background: #0f111a;
|
||||||
|
|
||||||
$card-border-color: #1e2435;
|
$card-border-color: #1e2435;
|
||||||
|
|
||||||
|
|
||||||
|
$context-menu-background: #0f111a;
|
||||||
|
$context-menu-background: #686970;
|
||||||
|
$context-menu-background: #16171d;
|
||||||
|
$context-menu-background: #090b10;
|
||||||
|
$context-menu-background-hover: #16171d;
|
||||||
|
$context-menu-font-color: #4e5572;
|
||||||
|
$context-menu-border-color: #4e5572;
|
||||||
|
$context-menu-border-color: #cccccc;
|
||||||
|
$context-menu-border-color: #181616;
|
||||||
|
$context-menu-border-color: #555661;
|
||||||
|
$context-menu-border-color: #4e5572;
|
Loading…
Reference in New Issue