@okjavis/nodebb-theme-javis 5.0.7 → 5.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scss/_header.scss +75 -1
- package/static/lib/theme.js +73 -0
package/package.json
CHANGED
package/scss/_header.scss
CHANGED
|
@@ -238,12 +238,46 @@
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
// ===========================================================
|
|
241
|
-
// NOTIFICATION DROPDOWN - Reduced width
|
|
241
|
+
// NOTIFICATION DROPDOWN - Reduced width with optimized text
|
|
242
242
|
// ===========================================================
|
|
243
243
|
.notifications-dropdown {
|
|
244
244
|
min-width: 300px !important;
|
|
245
245
|
max-width: 340px !important;
|
|
246
246
|
width: 300px !important;
|
|
247
|
+
padding: $jv-space-2 !important;
|
|
248
|
+
|
|
249
|
+
// Individual notification items (actual class is .unread or .read)
|
|
250
|
+
.unread, .read {
|
|
251
|
+
padding: $jv-space-2 !important;
|
|
252
|
+
|
|
253
|
+
// Make hover effect rectangular instead of pill-shaped
|
|
254
|
+
.btn, .btn-ghost {
|
|
255
|
+
border-radius: $jv-radius-sm !important;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// The link containing notification text
|
|
259
|
+
a[component="notifications/item/link"] {
|
|
260
|
+
font-size: 12px !important;
|
|
261
|
+
line-height: 1.5 !important;
|
|
262
|
+
word-wrap: break-word !important;
|
|
263
|
+
overflow-wrap: break-word !important;
|
|
264
|
+
word-break: break-word !important;
|
|
265
|
+
white-space: normal !important;
|
|
266
|
+
text-overflow: clip !important;
|
|
267
|
+
display: block !important;
|
|
268
|
+
|
|
269
|
+
strong {
|
|
270
|
+
font-size: 12px !important;
|
|
271
|
+
font-weight: 600 !important;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Timestamp
|
|
276
|
+
.text-xs.text-muted {
|
|
277
|
+
font-size: 11px !important;
|
|
278
|
+
margin-top: $jv-space-1 !important;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
247
281
|
}
|
|
248
282
|
|
|
249
283
|
// ===========================================================
|
|
@@ -315,6 +349,46 @@
|
|
|
315
349
|
min-width: 280px !important;
|
|
316
350
|
max-width: 90vw !important;
|
|
317
351
|
width: 280px !important;
|
|
352
|
+
padding: $jv-space-2 !important;
|
|
353
|
+
|
|
354
|
+
// Even smaller text on mobile for better fit
|
|
355
|
+
.notification-item,
|
|
356
|
+
[component="notifications/item"],
|
|
357
|
+
.list-group-item {
|
|
358
|
+
padding: $jv-space-2 $jv-space-3 !important;
|
|
359
|
+
font-size: 11px !important;
|
|
360
|
+
line-height: 1.3 !important;
|
|
361
|
+
|
|
362
|
+
p, .notification-text, .text-muted, div {
|
|
363
|
+
font-size: 11px !important;
|
|
364
|
+
line-height: 1.3 !important;
|
|
365
|
+
white-space: normal !important;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
time, .timeago, small {
|
|
369
|
+
font-size: 10px !important;
|
|
370
|
+
margin-top: 4px !important;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
strong, .fw-semibold, a {
|
|
374
|
+
font-size: 11px !important;
|
|
375
|
+
white-space: normal !important;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.dropdown-header {
|
|
380
|
+
padding: $jv-space-2 !important;
|
|
381
|
+
font-size: 11px !important;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.dropdown-footer,
|
|
385
|
+
.list-group-item:last-child {
|
|
386
|
+
padding: $jv-space-2 !important;
|
|
387
|
+
|
|
388
|
+
a, button {
|
|
389
|
+
font-size: 11px !important;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
318
392
|
}
|
|
319
393
|
}
|
|
320
394
|
}
|
package/static/lib/theme.js
CHANGED
|
@@ -57,6 +57,9 @@
|
|
|
57
57
|
// Fix mobile category dropdown positioning in composer
|
|
58
58
|
fixMobileComposerCategoryDropdown();
|
|
59
59
|
|
|
60
|
+
// Fix notification dropdown inline styles
|
|
61
|
+
fixNotificationDropdown();
|
|
62
|
+
|
|
60
63
|
// Initialize share button handlers
|
|
61
64
|
initShareHandlers();
|
|
62
65
|
|
|
@@ -67,6 +70,7 @@
|
|
|
67
70
|
initParentPostNavigation();
|
|
68
71
|
fixMobileFeedCategoryDropdown();
|
|
69
72
|
fixMobileComposerCategoryDropdown();
|
|
73
|
+
fixNotificationDropdown();
|
|
70
74
|
initPostHoverActions();
|
|
71
75
|
initFeedComposerPromptHandler();
|
|
72
76
|
initTopicListVoting();
|
|
@@ -884,6 +888,75 @@
|
|
|
884
888
|
console.log('JAVIS: Composer mobile fix event listener attached');
|
|
885
889
|
}
|
|
886
890
|
|
|
891
|
+
/**
|
|
892
|
+
* Fix notification dropdown width and text styling
|
|
893
|
+
* Removes Popper inline width styles and applies proper text wrapping
|
|
894
|
+
*/
|
|
895
|
+
function fixNotificationDropdown() {
|
|
896
|
+
console.log('JAVIS: fixNotificationDropdown called');
|
|
897
|
+
|
|
898
|
+
// Find the notification component
|
|
899
|
+
var $notificationComponent = $('[component="notifications"]');
|
|
900
|
+
if (!$notificationComponent.length) {
|
|
901
|
+
console.log('JAVIS: Notification component not found');
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
console.log('JAVIS: Notification component found, setting up fix');
|
|
906
|
+
|
|
907
|
+
// Listen for when dropdown is shown
|
|
908
|
+
$notificationComponent.off('shown.bs.dropdown.javisNotificationFix').on('shown.bs.dropdown.javisNotificationFix', function() {
|
|
909
|
+
console.log('JAVIS: Notification dropdown shown');
|
|
910
|
+
|
|
911
|
+
// Use requestAnimationFrame to ensure we override after Popper runs
|
|
912
|
+
requestAnimationFrame(function() {
|
|
913
|
+
var $dropdownMenu = $notificationComponent.find('.notifications-dropdown');
|
|
914
|
+
|
|
915
|
+
if ($dropdownMenu.length) {
|
|
916
|
+
// Remove width-related inline styles from dropdown
|
|
917
|
+
var currentStyle = $dropdownMenu.attr('style') || '';
|
|
918
|
+
var newStyle = currentStyle
|
|
919
|
+
.replace(/min-width:\s*[^;]+;?/gi, '')
|
|
920
|
+
.replace(/max-width:\s*[^;]+;?/gi, '')
|
|
921
|
+
.replace(/width:\s*[^;]+;?/gi, '');
|
|
922
|
+
$dropdownMenu.attr('style', newStyle);
|
|
923
|
+
|
|
924
|
+
// Apply styling to notification items (.unread and .read are the actual classes)
|
|
925
|
+
$dropdownMenu.find('.unread, .read').css({
|
|
926
|
+
'padding': '8px'
|
|
927
|
+
});
|
|
928
|
+
|
|
929
|
+
// Style the notification link text
|
|
930
|
+
$dropdownMenu.find('a[component="notifications/item/link"]').css({
|
|
931
|
+
'font-size': '12px',
|
|
932
|
+
'line-height': '1.5',
|
|
933
|
+
'word-wrap': 'break-word',
|
|
934
|
+
'overflow-wrap': 'break-word',
|
|
935
|
+
'word-break': 'break-word',
|
|
936
|
+
'white-space': 'normal',
|
|
937
|
+
'text-overflow': 'clip',
|
|
938
|
+
'display': 'block'
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
// Style strong tags within notifications
|
|
942
|
+
$dropdownMenu.find('a[component="notifications/item/link"] strong').css({
|
|
943
|
+
'font-size': '12px',
|
|
944
|
+
'font-weight': '600'
|
|
945
|
+
});
|
|
946
|
+
|
|
947
|
+
// Style timestamps
|
|
948
|
+
$dropdownMenu.find('.text-xs.text-muted').css({
|
|
949
|
+
'font-size': '11px'
|
|
950
|
+
});
|
|
951
|
+
|
|
952
|
+
console.log('JAVIS: Notification dropdown styling applied');
|
|
953
|
+
}
|
|
954
|
+
});
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
console.log('JAVIS: Notification dropdown fix event listener attached');
|
|
958
|
+
}
|
|
959
|
+
|
|
887
960
|
/**
|
|
888
961
|
* Initialize immediate category filter navigation on feed page
|
|
889
962
|
* When a category is selected, navigate immediately instead of waiting for dropdown close
|