-
-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
356 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/lib/modules/menu/floating-menu/floating-menu.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<ng-container *ngFor="let toolbarItem of toolbar; let lastToolbarItem = last"> | ||
<ng-container *ngFor="let item of toolbarItem; let lastItem = last"> | ||
<div class="NgxFloatingMenu__Icon" [ngClass]="{'NgxFloatingMenu__Icon--Active': this.activeItems.includes(item), | ||
'NgxEditor--Disabled': !this.execulableItems.includes(item)}" (mousedown)="onClick($event, item)" | ||
*ngIf="toggleCommands.includes(item)"> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="20" width="20" | ||
[innerHTML]="getIcon(item)"></svg> | ||
</div> | ||
<div class="NgxFloatingMenu__Seperator" *ngIf="lastItem && !lastToolbarItem"></div> | ||
</ng-container> | ||
</ng-container> |
57 changes: 57 additions & 0 deletions
57
src/lib/modules/menu/floating-menu/floating-menu.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
:host { | ||
position: absolute; | ||
z-index: 20; | ||
margin-bottom: 0.35rem; | ||
display: flex; | ||
border-radius: 4px; | ||
background-color: #000; | ||
color: white; | ||
display: flex; | ||
height: 1.85rem; | ||
padding: 0.2rem 0.3rem; | ||
visibility: hidden; | ||
} | ||
|
||
.NgxFloatingMenu__Icon { | ||
height: 1.8rem; | ||
width: 1.8rem; | ||
transition: 0.3s ease-in-out; | ||
border-radius: 2px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
svg { | ||
fill: white; | ||
} | ||
|
||
&:hover { | ||
background-color: #636262; | ||
} | ||
|
||
+ .NgxFloatingMenu__Icon { | ||
margin-left: 0.3rem; | ||
} | ||
} | ||
|
||
.NgxFloatingMenu__Icon--Active { | ||
background-color: white; | ||
|
||
svg { | ||
fill: black; | ||
} | ||
|
||
&:hover { | ||
background-color: #636262; | ||
|
||
svg { | ||
fill: white; | ||
} | ||
} | ||
} | ||
|
||
.NgxFloatingMenu__Seperator { | ||
border-left: 1px solid white; | ||
height: 100%; | ||
margin: 0 5px; | ||
} |
37 changes: 37 additions & 0 deletions
37
src/lib/modules/menu/floating-menu/floating-menu.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { FloatingMenuComponent } from './floating-menu.component'; | ||
import { SanitizeHtmlPipe } from '../../../pipes/sanitize/sanitize-html.pipe'; | ||
import Editor from '../../../Editor'; | ||
|
||
describe('FloatingMenuComponent', () => { | ||
let component: FloatingMenuComponent; | ||
let fixture: ComponentFixture<FloatingMenuComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ | ||
FloatingMenuComponent | ||
], | ||
providers: [ | ||
SanitizeHtmlPipe | ||
] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(FloatingMenuComponent); | ||
component = fixture.componentInstance; | ||
component.editor = new Editor(); | ||
fixture.detectChanges(); | ||
}); | ||
|
||
afterEach(() => { | ||
component.editor.destroy(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.