Skip to content

Commit ac52fc9

Browse files
committed
Merge branch '4.0.0-dev' of https://github.com/themeum/tutor into 4.0.0-dev
2 parents c5a177c + d725f09 commit ac52fc9

22 files changed

Lines changed: 143 additions & 107 deletions

File tree

assets/core/scss/components/_calendar.scss

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@
3535

3636
button {
3737
box-shadow: none;
38+
transition: none;
39+
@include tutor-transition((background-color, color));
3840
}
3941

4042
button[data-vc-arrow],
41-
button[data-vc=month],
42-
button[data-vc=year] {
43+
button[data-vc='month'],
44+
button[data-vc='year'] {
4345
background-color: transparent;
4446
color: $tutor-text-primary;
45-
padding: 0px;
46-
47+
4748
&:hover,
4849
&:focus {
4950
background-color: transparent;
@@ -157,6 +158,7 @@
157158
flex-wrap: wrap;
158159
border-bottom: 1px solid $tutor-border-idle;
159160
padding-bottom: $tutor-spacing-4;
161+
margin-bottom: $tutor-spacing-4;
160162

161163
button {
162164
width: 50%;
@@ -171,6 +173,14 @@
171173

172174
.vc-grid {
173175
grid-area: grid;
176+
display: flex;
177+
gap: $tutor-spacing-6;
178+
179+
@include tutor-breakpoint-down(md) {
180+
.vc-column:nth-child(n+2) {
181+
display: none;
182+
}
183+
}
174184
}
175185

176186
[data-vc='time'] {
@@ -180,4 +190,4 @@
180190
.vc-footer {
181191
grid-area: footer;
182192
}
183-
}
193+
}

assets/core/scss/components/_preview-trigger.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
@use '../mixins' as *;
66

77
.tutor-preview-trigger {
8-
display: inline;
8+
display: inline-flex;
9+
vertical-align: middle;
10+
max-width: 100%;
11+
min-width: 0;
12+
width: 100%;
913
position: relative;
1014

1115
&-text {
@@ -15,6 +19,14 @@
1519
color: $tutor-text-secondary;
1620
cursor: pointer;
1721
@include tutor-transition(color);
22+
padding-inline-end: $tutor-spacing-1;
23+
24+
display: inline-block;
25+
white-space: nowrap;
26+
overflow: hidden;
27+
text-overflow: ellipsis;
28+
max-width: 100%;
29+
vertical-align: bottom;
1830
}
1931
}
2032

assets/core/scss/main.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
*::before,
2626
*::after {
2727
box-sizing: border-box;
28+
-webkit-tap-highlight-color: transparent;
29+
-webkit-touch-callout: none;
2830
}
2931

3032
html {

assets/core/ts/components/preview-trigger.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ export const previewTrigger = (props: PreviewTriggerProps = {}) => {
5252
if (this.isTouchDevice) {
5353
// Mobile: tap to toggle
5454
trigger.addEventListener('click', (e: Event) => this.handleTap(e as MouseEvent));
55+
56+
// Prevent clicks inside content from bubbling to trigger on mobile
57+
// This ensures links inside content work and tapping content doesn't toggle the popover
58+
const content = this.$refs.content;
59+
if (content) {
60+
content.addEventListener('click', (e: Event) => {
61+
e.stopPropagation();
62+
});
63+
}
5564
} else {
5665
// Desktop: hover to show
5766
trigger.addEventListener('mouseenter', () => this.handleMouseEnter());
@@ -72,6 +81,15 @@ export const previewTrigger = (props: PreviewTriggerProps = {}) => {
7281
},
7382

7483
handleTap(event: MouseEvent) {
84+
const target = event.target as HTMLElement;
85+
const content = this.$refs.content;
86+
87+
// If the tap is inside the preview content, let it be handled there
88+
// This is a fallback in case propagation wasn't stopped
89+
if (content && content.contains(target)) {
90+
return;
91+
}
92+
7593
event.preventDefault();
7694
if (this.open) {
7795
this.hide();
@@ -136,10 +154,13 @@ export const previewTrigger = (props: PreviewTriggerProps = {}) => {
136154
if (!this.previewData) return;
137155

138156
const data = this.previewData;
157+
const thumbnailHtml = data.thumbnail
158+
? `<img src="${data.thumbnail}" alt="${this.escapeHtml(data.title)}" class="tutor-preview-card-thumbnail" />`
159+
: '';
139160

140161
content.innerHTML = `
141162
<div class="tutor-preview-card-content">
142-
${data.thumbnail ? `<img src="${data.thumbnail}" alt="${this.escapeHtml(data.title)}" class="tutor-preview-card-thumbnail" />` : ''}
163+
${data.thumbnail ? (data.url ? `<a href="${data.url}">${thumbnailHtml}</a>` : thumbnailHtml) : ''}
143164
<div class="tutor-preview-card-body">
144165
<h4 class="tutor-preview-card-title">${data.url ? `<a href="${data.url}">${this.escapeHtml(data.title)}</a>` : this.escapeHtml(data.title)}</h4>
145166
${data.instructor ? `<div class="tutor-preview-card-instructor">${sprintf(__(`by <a href="${data.instructor_url}">%s</a>`, 'tutor'), this.escapeHtml(data.instructor))}</div>` : ''}

assets/src/js/front/course/_spotlight.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
368368
const post = await ajaxHandler(formData);
369369
if (post.ok) {
370370
const response = await post.json();
371-
if (!response) {
371+
if (response.status_code !== 200 ) {
372372
tutor_toast(__('Warning', 'tutor'), __(`Attachment remove failed`, 'tutor'), 'error');
373373
} else {
374374
currentTarget.closest('.tutor-instructor-card').remove();

assets/src/js/frontend/learning-area/quiz/layout.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ const quizLayout = (config: QuizLayoutConfig) => {
227227
return;
228228
}
229229

230+
if (!this.isQuestionAttempted(this.currentIndex)) {
231+
this.moveToNextQuestion();
232+
return;
233+
}
234+
230235
this.isRevealing = true;
231236
this.revealQuestion(wrapper);
232237
this.syncRevealFooterState(wrapper);

assets/src/scss/frontend/components/_discussion-card.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,33 @@
6363

6464
&-content {
6565
width: 100%;
66+
min-width: 0;
67+
flex: 1;
6668
}
6769

6870
&-top {
6971
@include tutor-typography(tiny);
7072
@include tutor-flex(row, center);
7173
gap: $tutor-spacing-5;
7274
margin-block: $tutor-spacing-3;
75+
min-width: 0;
76+
overflow: hidden;
77+
padding-inline-end: $tutor-spacing-17;
78+
79+
> div {
80+
min-width: 0;
81+
}
7382

7483
@include tutor-breakpoint-down(sm) {
7584
flex-direction: column;
7685
align-items: flex-start;
7786
gap: $tutor-spacing-none;
7887
margin-bottom: $tutor-spacing-4;
88+
padding-inline-end: $tutor-spacing-9;
89+
90+
> div {
91+
width: 100%;
92+
}
7993
}
8094
}
8195

assets/src/scss/frontend/components/_quiz-attempts.scss

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
}
4343
}
4444

45+
.tutor-quiz-attempts-header-item:last-of-type {
46+
text-align: center;
47+
}
48+
4549
.tutor-quiz-attempts-item-wrapper {
4650
padding: $tutor-spacing-6;
4751

@@ -51,23 +55,6 @@
5155

5256
&:hover {
5357
background-color: $tutor-surface-l1-hover;
54-
.tutor-quiz-attempts-item {
55-
.tutor-quiz-item-info {
56-
.tutor-quiz-attempts-expand-btn {
57-
@include tutor-flex(row, center);
58-
}
59-
}
60-
}
61-
}
62-
63-
&.tutor-quiz-previous-attempts {
64-
.tutor-quiz-attempts-item {
65-
.tutor-quiz-item-info {
66-
.tutor-quiz-attempts-expand-btn {
67-
@include tutor-flex(row, center);
68-
}
69-
}
70-
}
7158
}
7259

7360
&.tutor-quiz-previous-attempts {
@@ -115,13 +102,15 @@
115102
grid-area: info;
116103

117104
&-expanded {
118-
@include tutor-flex(row, center);
105+
@include tutor-flex(row, start);
119106
gap: $tutor-spacing-4;
120107
text-align: center;
108+
min-height: 24px;
121109
}
122110

123111
&-title {
124112
@include tutor-typography(medium, semibold);
113+
text-align: start;
125114

126115
@include tutor-breakpoint-down(sm) {
127116
font-size: $tutor-font-size-small;
@@ -149,15 +138,15 @@
149138
}
150139

151140
.tutor-quiz-attempts-expand-btn {
152-
display: none;
153141
@include tutor-button-reset();
142+
@include tutor-flex(row, center);
154143
gap: $tutor-spacing-2;
155144
@include tutor-typography(small, medium, brand);
156145
cursor: pointer;
157146
white-space: nowrap;
158147

159148
@include tutor-breakpoint-down(sm) {
160-
@include tutor-flex(row,center);
149+
@include tutor-flex(row, center);
161150
font-size: $tutor-font-size-tiny;
162151
line-height: $tutor-line-height-tiny;
163152
}
@@ -242,7 +231,7 @@
242231

243232
.tutor-quiz-item-result {
244233
grid-area: result;
245-
@include tutor-flex(column, left, center);
234+
@include tutor-flex(column, center, center);
246235

247236
@include tutor-breakpoint-down(sm) {
248237
height: 100%;
@@ -376,16 +365,6 @@
376365
border-radius: $tutor-radius-2xl;
377366
}
378367
}
379-
380-
.tutor-quiz-students-attempts {
381-
&-filter-item {
382-
&:first-child {
383-
button {
384-
padding: 0;
385-
}
386-
}
387-
}
388-
}
389368
}
390369

391370
.tutor-quiz-item-actions {

assets/src/scss/frontend/dashboard/_billing.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
}
7373

7474
&-card {
75-
@include tutor-flex(row, center, space-between);
75+
@include tutor-flex(row, start, space-between);
7676
border-bottom: 1px solid $tutor-border-idle;
7777
padding: $tutor-spacing-6;
7878
gap: $tutor-spacing-4;

assets/src/scss/frontend/dashboard/_subscription-history.scss

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@use '@Core/scss/tokens' as *;
22
@use '@Core/scss/mixins' as *;
33

4+
// @TODO:: Move this to pro plugin
45
[data-subscription-details="1"] {
56
@include tutor-breakpoint-down(sm) {
67
.tutor-billing-header {
@@ -43,30 +44,6 @@
4344
color: $tutor-text-subdued;
4445
}
4546
}
46-
47-
&-action-btn {
48-
@include tutor-button-base;
49-
@include tutor-button-variant('link');
50-
@include tutor-button-size('small');
51-
padding: 0;
52-
min-height: unset;
53-
gap: $tutor-spacing-2;
54-
color: $tutor-text-brand;
55-
position: relative;
56-
margin-right: -$tutor-spacing-7;
57-
58-
svg {
59-
opacity: 0;
60-
}
61-
62-
&:hover {
63-
margin-right: 0;
64-
65-
svg {
66-
opacity: 1;
67-
}
68-
}
69-
}
7047
}
7148

7249
}

0 commit comments

Comments
 (0)