Skip to content

Commit d6ff604

Browse files
committed
fix: color picker positioning
1 parent e8d2912 commit d6ff604

File tree

5 files changed

+22
-12
lines changed

5 files changed

+22
-12
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wfpena/angular-wysiwyg",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",

projects/angular-editor/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wfpena/angular-wysiwyg",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "A rich WYSIWYG text editor for Angular 13+. Rich Text editor component for Angular built using Angular 17.",
55
"author": "Wilson Pena <wilsonf.pena@gmail.com>",
66
"repository": "https://github.com/wfpena/angular-wysiwyg",

projects/angular-editor/src/lib/angular-editor-toolbar.component.html

+17-10
Original file line numberDiff line numberDiff line change
@@ -95,24 +95,31 @@
9595
title="Font Size">
9696
</ae-select>
9797
</div>
98-
<div class="angular-editor-toolbar-set">
98+
<div class="angular-editor-toolbar-set" style="position: relative;">
9999
<input
100-
style="display: none"
101-
type="color" (change)="insertColor(fgInput.value, 'textColor')"
100+
type="color"
101+
(change)="insertColor(fgInput.value, 'textColor')"
102+
style="visibility: hidden;height: 0px; width: 0px; position: absolute; left: 25px;"
103+
[style.top]="toolbarPosition !== 'bottom' ? '-225px' : '225px'"
102104
#fgInput>
103-
<button [id]="'foregroundColorPicker-'+id" type="button" class="angular-editor-button" (click)="focus(); ; fgInput.click()"
105+
<button [id]="'foregroundColorPicker-'+id" type="button" class="angular-editor-button" (click)="fgInput.click()"
104106
title="Text Color"
105107
[disabled]="htmlMode" [hidden]="isButtonHidden('textColor')" tabindex="-1"><span
106108
class="color-label foreground"><i class="fa fa-font"></i></span>
107109
</button>
110+
</div>
111+
<div class="angular-editor-toolbar-set" style="position: relative;">
108112
<input
109-
style="display: none"
110-
type="color" (change)="insertColor(bgInput.value, 'backgroundColor')"
113+
type="color"
114+
(change)="insertColor(bgInput.value, 'backgroundColor')"
115+
style="visibility: hidden;height: 0px; width: 0px; position: absolute; left: 25px;"
116+
[style.top]="toolbarPosition !== 'bottom' ? '-225px' : '225px'"
111117
#bgInput>
112-
<button [id]="'backgroundColorPicker-'+id" type="button" class="angular-editor-button" (click)="focus(); ; bgInput.click()"
113-
title="Background Color"
114-
[disabled]="htmlMode" [hidden]="isButtonHidden('backgroundColor')" tabindex="-1"><span
115-
class="color-label background"><i class="fa fa-font"></i></span>
118+
<button [id]="'backgroundColorPicker-'+id" type="button" class="angular-editor-button" (click)="bgInput.click()"
119+
title="Background ColorA"
120+
[disabled]="htmlMode"
121+
[hidden]="isButtonHidden('backgroundColor')"
122+
tabindex="-1"><span class="color-label background"><i class="fa fa-font"></i></span>
116123
</button>
117124
</div>
118125
<div *ngIf="_customClasses" class="angular-editor-toolbar-set">

projects/angular-editor/src/lib/angular-editor-toolbar.component.ts

+2
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ export class AngularEditorToolbarComponent {
166166
}
167167
}
168168

169+
@Input() toolbarPosition: string;
170+
169171
@Input() hiddenButtons: string[][];
170172

171173
@Output() execute: EventEmitter<string> = new EventEmitter<string>();

projects/angular-editor/src/lib/angular-editor.component.html

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
[defaultFontName]="config.defaultFontName"
6969
[defaultFontSize]="config.defaultFontSize"
7070
[hiddenButtons]="config.toolbarHiddenButtons"
71+
[toolbarPosition]="config.toolbarPosition"
7172
(execute)="executeCommand($event)"
7273
></angular-editor-toolbar>
7374
</div>

0 commit comments

Comments
 (0)