Skip to content

Commit a61e66a

Browse files
committed
Bug fixes for the inline mode and small style tweak
1 parent 94b65c5 commit a61e66a

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

example/src/app/app.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ <h4><b>by Alberto Pujante</b></h4>
347347
&lt;span [(colorPicker)]="arrayColors[selectedColor]"
348348
[cpDialogDisplay]="'inline'"
349349
[style.background]="arrayColors[selectedColor]"
350+
[cpCancelButton]="true"
350351
[cpToggle]="true"&gt;&lt;/span&gt;
351352

352353
&lt;div [style.background]="arrayColors['color']"

src/lib/color-picker.component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
width: 230px;
4545
height: auto;
4646
border:#777 solid 1px;
47-
left:30px;
48-
top:250px;
4947
position:absolute;
5048
z-index:100000;
5149
background-color: #fff;
@@ -219,6 +217,7 @@
219217
left: 8px;
220218
position:absolute;
221219
@include border-radius(50%);
220+
border: 1px solid #a9a9a9;
222221
}
223222

224223
.selected-color-background{

src/lib/color-picker.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,16 @@ export class ColorPickerComponent implements OnInit, AfterViewInit {
264264
onResize() {
265265
if (this.position === 'fixed') {
266266
this.setDialogPosition();
267-
} else {
268-
this.closeColorPicker();
267+
} else if (this.cpDialogDisplay !== 'inline') {
268+
this.closeColorPicker();
269269
}
270270
}
271271

272272
setDialogPosition() {
273+
if (this.cpDialogDisplay === 'inline') {
274+
this.position = 'relative';
275+
return;
276+
}
273277
let dialogHeight = this.dialogElement.nativeElement.offsetHeight;
274278
let node = this.directiveElementRef.nativeElement.parentNode, position = 'static', transform = '';
275279
let parentNode: any = null, transformNode: any = null, style: any = null;

0 commit comments

Comments
 (0)