Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 886a0f7

Browse files
merge: from master
2 parents 0ac281c + a6787c4 commit 886a0f7

File tree

3 files changed

+21
-41
lines changed

3 files changed

+21
-41
lines changed

studio/src/app/components/feed/card/app-feed-card-tags/app-feed-card-tags.scss

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@ app-feed-card-tags {
1616
display: inline-flex;
1717
align-items: center;
1818
justify-content: center;
19-
padding: 4px 8px;
20-
21-
&:not(:first-of-type) {
22-
margin: 0 4px;
23-
}
19+
padding: 2px 8px;
20+
margin: 4px 2px;
2421

2522
font-size: var(--font-size-normal);
2623

studio/src/app/components/feed/card/app-feed-card/app-feed-card.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ app-feed-card {
1111
}
1212
}
1313

14+
p.content {
15+
margin: 0;
16+
}
17+
1418
ion-card-title {
1519
white-space: nowrap;
1620
overflow: hidden;
@@ -37,6 +41,7 @@ app-feed-card {
3741

3842
app-feed-card-tags {
3943
display: block;
44+
height: 100%;
4045
}
4146
}
4247

studio/src/app/popovers/editor/app-code/app-code.tsx

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ export class AppCode {
3838
@Prop()
3939
codeDidChange: EventEmitter<HTMLElement>;
4040

41-
private hidePopoverTimer;
42-
4341
private prismService: PrismService;
4442

4543
private currentLanguage: string = 'javascript';
@@ -98,20 +96,18 @@ export class AppCode {
9896
});
9997
}
10098

101-
private selectColor($event, colorFunction: Function): Promise<void> {
99+
private selectColor($event: CustomEvent, colorFunction: Function): Promise<void> {
102100
return new Promise<void>(async (resolve) => {
103101
if (!this.selectedElement || !this.selectedElement.parentElement) {
104102
resolve();
105103
return;
106104
}
107105

108-
if (!$event || !$event.target || !$event.target.value) {
106+
if (!$event || !$event.detail) {
109107
resolve();
110108
return;
111109
}
112110

113-
await this.privateHideShowPopover();
114-
115111
colorFunction($event);
116112

117113
this.emitCodeDidChange();
@@ -120,34 +116,16 @@ export class AppCode {
120116
});
121117
}
122118

123-
private setCodeColor = ($event) => {
124-
this.codeColor = $event.target.value;
125-
this.selectedElement.style.setProperty(this.getStyle(), $event.target.value);
119+
private setCodeColor = ($event: CustomEvent) => {
120+
this.codeColor = $event.detail.hex;
121+
this.selectedElement.style.setProperty(this.getStyle(), $event.detail.hex);
126122
};
127123

128-
private setHighlightColor = ($event) => {
129-
this.highlightColor = $event.target.value;
130-
this.selectedElement.style.setProperty('--deckgo-highlight-code-line-background', $event.target.value);
124+
private setHighlightColor = ($event: CustomEvent) => {
125+
this.highlightColor = $event.detail.hex;
126+
this.selectedElement.style.setProperty('--deckgo-highlight-code-line-background', $event.detail.hex);
131127
};
132128

133-
private privateHideShowPopover(): Promise<void> {
134-
return new Promise<void>((resolve) => {
135-
const popover: HTMLIonPopoverElement = this.el.closest('ion-popover');
136-
137-
popover.style.visibility = 'hidden';
138-
139-
if (this.hidePopoverTimer) {
140-
clearTimeout(this.hidePopoverTimer);
141-
}
142-
143-
this.hidePopoverTimer = setTimeout(() => {
144-
popover.style.visibility = 'initial';
145-
}, 1000);
146-
147-
resolve();
148-
});
149-
}
150-
151129
private toggleCodeLanguage($event: CustomEvent): Promise<void> {
152130
return new Promise<void>(async (resolve) => {
153131
if (!this.selectedElement) {
@@ -432,9 +410,9 @@ export class AppCode {
432410
</ion-item>
433411

434412
<ion-item disabled={this.codeColorType === undefined}>
435-
<ion-label>Color</ion-label>
436-
<input type="color" value={this.codeColor}
437-
onChange={(e) => this.selectColor(e, this.setCodeColor)}></input>
413+
<deckgo-color class="ion-padding-top ion-padding-bottom" onColorChange={($event: CustomEvent) => this.selectColor($event, this.setCodeColor)} color-hex={this.codeColor}>
414+
<ion-icon name="more" ios="md-mode" md="md-more" slot="more" aria-label="More" class="more"></ion-icon>
415+
</deckgo-color>
438416
</ion-item>
439417

440418
<ion-item-divider class="ion-padding-top">
@@ -451,9 +429,9 @@ export class AppCode {
451429
</ion-item>
452430

453431
<ion-item disabled={!this.highlightLines}>
454-
<ion-label>Color</ion-label>
455-
<input type="color" value={this.highlightColor}
456-
onChange={(e) => this.selectColor(e, this.setHighlightColor)}></input>
432+
<deckgo-color class="ion-padding-top ion-padding-bottom" onColorChange={($event: CustomEvent) => this.selectColor($event, this.setHighlightColor)} color-hex={this.highlightColor}>
433+
<ion-icon name="more" ios="md-mode" md="md-more" slot="more" aria-label="More" class="more"></ion-icon>
434+
</deckgo-color>
457435
</ion-item>
458436
</ion-list>]
459437
}

0 commit comments

Comments
 (0)