@okjavis/nodebb-theme-javis 5.0.2 → 5.0.4
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/_base.scss +33 -0
- package/scss/_feed.scss +40 -0
- package/scss/_header.scss +28 -0
- package/static/lib/theme.js +77 -0
- package/templates/partials/header/brand.tpl +7 -0
package/package.json
CHANGED
package/scss/_base.scss
CHANGED
|
@@ -307,3 +307,36 @@ a {
|
|
|
307
307
|
border-top: 1px solid $jv-border-subtle;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
+
|
|
311
|
+
// ===========================================================
|
|
312
|
+
// MOBILE NAVIGATION - Hide Chat and Notification Widgets
|
|
313
|
+
// ===========================================================
|
|
314
|
+
// Hide chat and notifications from mobile bottom navbar only
|
|
315
|
+
@media (max-width: 767px) {
|
|
316
|
+
// Hide notifications widget - multiple selectors for comprehensive coverage
|
|
317
|
+
li[component="notifications"],
|
|
318
|
+
nav[component="sidebar/left"] li[component="notifications"],
|
|
319
|
+
.sidebar-left li[component="notifications"],
|
|
320
|
+
.nav-item.notifications {
|
|
321
|
+
display: none !important;
|
|
322
|
+
visibility: hidden !important;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Hide chat widget - multiple selectors for comprehensive coverage
|
|
326
|
+
li.chats,
|
|
327
|
+
nav[component="sidebar/left"] li.chats,
|
|
328
|
+
.sidebar-left li.chats,
|
|
329
|
+
.nav-item.chats {
|
|
330
|
+
display: none !important;
|
|
331
|
+
visibility: hidden !important;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// Also hide drafts widget if present
|
|
335
|
+
li[component="sidebar/drafts"],
|
|
336
|
+
nav[component="sidebar/left"] li[component="sidebar/drafts"],
|
|
337
|
+
.sidebar-left li[component="sidebar/drafts"],
|
|
338
|
+
.nav-item.drafts {
|
|
339
|
+
display: none !important;
|
|
340
|
+
visibility: hidden !important;
|
|
341
|
+
}
|
|
342
|
+
}
|
package/scss/_feed.scss
CHANGED
|
@@ -1017,6 +1017,8 @@ ul.categories-list {
|
|
|
1017
1017
|
}
|
|
1018
1018
|
|
|
1019
1019
|
.feed-category-filter {
|
|
1020
|
+
// Ensure proper positioning context for dropdown
|
|
1021
|
+
position: relative !important;
|
|
1020
1022
|
.category-dropdown-container,
|
|
1021
1023
|
[component="category/dropdown"] {
|
|
1022
1024
|
// Override the btn-group styling
|
|
@@ -1135,3 +1137,41 @@ ul.categories-list {
|
|
|
1135
1137
|
}
|
|
1136
1138
|
}
|
|
1137
1139
|
}
|
|
1140
|
+
|
|
1141
|
+
// ===========================================================
|
|
1142
|
+
// MOBILE FIX - Category dropdown positioning
|
|
1143
|
+
// Fix dropdown opening from bottom left corner on mobile
|
|
1144
|
+
// ===========================================================
|
|
1145
|
+
@media (max-width: 767px) {
|
|
1146
|
+
.feed-category-filter {
|
|
1147
|
+
// Ensure button group has proper positioning
|
|
1148
|
+
.category-dropdown-container,
|
|
1149
|
+
[component="category/dropdown"],
|
|
1150
|
+
.btn-group {
|
|
1151
|
+
position: relative !important;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
// Force dropdown to position relative to button, not viewport
|
|
1155
|
+
// Use extremely high specificity to override Popper's inline styles
|
|
1156
|
+
.dropdown-menu {
|
|
1157
|
+
// Disable all transitions and animations on mobile
|
|
1158
|
+
transition: none !important;
|
|
1159
|
+
animation: none !important;
|
|
1160
|
+
|
|
1161
|
+
&.show {
|
|
1162
|
+
position: absolute !important;
|
|
1163
|
+
top: 100% !important;
|
|
1164
|
+
right: 0 !important;
|
|
1165
|
+
left: auto !important;
|
|
1166
|
+
bottom: auto !important;
|
|
1167
|
+
transform: none !important;
|
|
1168
|
+
margin: 4px 0 0 0 !important;
|
|
1169
|
+
// Ensure dropdown has proper dimensions
|
|
1170
|
+
width: auto !important;
|
|
1171
|
+
min-width: 200px !important;
|
|
1172
|
+
max-height: none !important;
|
|
1173
|
+
height: auto !important;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}
|
package/scss/_header.scss
CHANGED
|
@@ -262,6 +262,26 @@
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
+
// ===========================================================
|
|
266
|
+
// MOBILE HEADER LOGO (hidden on desktop)
|
|
267
|
+
// ===========================================================
|
|
268
|
+
.javis-mobile-header-logo {
|
|
269
|
+
display: none !important; // Hidden by default on desktop
|
|
270
|
+
|
|
271
|
+
.javis-mobile-logo-link {
|
|
272
|
+
display: flex;
|
|
273
|
+
align-items: center;
|
|
274
|
+
justify-content: center;
|
|
275
|
+
text-decoration: none;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.javis-mobile-logo-img {
|
|
279
|
+
max-width: 120px; // Logo width on mobile
|
|
280
|
+
height: 32px; // Logo height on mobile
|
|
281
|
+
object-fit: contain;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
265
285
|
@media (max-width: 767px) {
|
|
266
286
|
.brand-container {
|
|
267
287
|
// Hide search in header on mobile (use mobile header instead)
|
|
@@ -272,6 +292,14 @@
|
|
|
272
292
|
> .col-12 {
|
|
273
293
|
justify-content: center;
|
|
274
294
|
}
|
|
295
|
+
|
|
296
|
+
// Show mobile logo on mobile devices only
|
|
297
|
+
.javis-mobile-header-logo {
|
|
298
|
+
display: flex !important; // Show on mobile
|
|
299
|
+
align-items: center;
|
|
300
|
+
justify-content: center;
|
|
301
|
+
flex-shrink: 0;
|
|
302
|
+
}
|
|
275
303
|
}
|
|
276
304
|
}
|
|
277
305
|
|
package/static/lib/theme.js
CHANGED
|
@@ -51,11 +51,15 @@
|
|
|
51
51
|
// Initialize immediate category filter navigation on feed page
|
|
52
52
|
initFeedCategoryFilter();
|
|
53
53
|
|
|
54
|
+
// Fix mobile category dropdown positioning on feed page
|
|
55
|
+
fixMobileFeedCategoryDropdown();
|
|
56
|
+
|
|
54
57
|
// Re-initialize carousels when new posts are loaded (infinite scroll, etc.)
|
|
55
58
|
// Also handle post edits by clearing the processed flag
|
|
56
59
|
$(window).on('action:posts.loaded action:topic.loaded action:ajaxify.end', function() {
|
|
57
60
|
initPostImageCarousels();
|
|
58
61
|
initParentPostNavigation();
|
|
62
|
+
fixMobileFeedCategoryDropdown();
|
|
59
63
|
initPostHoverActions();
|
|
60
64
|
initFeedComposerPromptHandler();
|
|
61
65
|
initTopicListVoting();
|
|
@@ -728,6 +732,79 @@
|
|
|
728
732
|
});
|
|
729
733
|
}
|
|
730
734
|
|
|
735
|
+
/**
|
|
736
|
+
* Fix mobile category dropdown positioning on feed page
|
|
737
|
+
* Aggressively overrides Popper.js positioning on mobile to prevent bottom-left corner issue
|
|
738
|
+
*/
|
|
739
|
+
function fixMobileFeedCategoryDropdown() {
|
|
740
|
+
console.log('JAVIS: fixMobileFeedCategoryDropdown called, window width:', window.innerWidth);
|
|
741
|
+
|
|
742
|
+
// Only run on feed page
|
|
743
|
+
if (!$('.feed').length) {
|
|
744
|
+
console.log('JAVIS: Not on feed page, exiting');
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
console.log('JAVIS: On feed page, looking for category filter');
|
|
749
|
+
|
|
750
|
+
var $categoryFilter = $('.feed-category-filter [component="category/dropdown"]');
|
|
751
|
+
if (!$categoryFilter.length) {
|
|
752
|
+
console.log('JAVIS: Category filter not found');
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
console.log('JAVIS: Category filter found, setting up mobile fix');
|
|
757
|
+
|
|
758
|
+
// Find the dropdown button and menu
|
|
759
|
+
var $dropdownButton = $categoryFilter.find('.dropdown-toggle');
|
|
760
|
+
var $dropdownMenu = $categoryFilter.find('.dropdown-menu');
|
|
761
|
+
|
|
762
|
+
if (!$dropdownButton.length || !$dropdownMenu.length) {
|
|
763
|
+
console.log('JAVIS: Dropdown button or menu not found');
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
// Disable Popper immediately on mobile to prevent animation from bottom-left
|
|
768
|
+
if (window.innerWidth <= 767) {
|
|
769
|
+
$dropdownButton.attr('data-bs-display', 'static');
|
|
770
|
+
console.log('JAVIS: Disabled Popper positioning on mobile');
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
// Always bind the event, but check window width when it fires
|
|
774
|
+
$categoryFilter.off('shown.bs.dropdown.javisMobileFix').on('shown.bs.dropdown.javisMobileFix', function() {
|
|
775
|
+
console.log('JAVIS: Dropdown shown event fired, window width:', window.innerWidth);
|
|
776
|
+
|
|
777
|
+
// Only apply fix on mobile
|
|
778
|
+
if (window.innerWidth > 767) {
|
|
779
|
+
console.log('JAVIS: Not mobile, skipping positioning fix');
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
console.log('JAVIS: Applying mobile positioning fix');
|
|
784
|
+
|
|
785
|
+
// Use requestAnimationFrame to ensure we override after Popper runs
|
|
786
|
+
requestAnimationFrame(function() {
|
|
787
|
+
$dropdownMenu.css({
|
|
788
|
+
'position': 'absolute',
|
|
789
|
+
'top': '100%',
|
|
790
|
+
'right': '0',
|
|
791
|
+
'left': 'auto',
|
|
792
|
+
'bottom': 'auto',
|
|
793
|
+
'transform': 'none',
|
|
794
|
+
'margin': '4px 0 0 0',
|
|
795
|
+
'inset': 'auto'
|
|
796
|
+
});
|
|
797
|
+
|
|
798
|
+
// Also remove Popper attributes
|
|
799
|
+
$dropdownMenu.removeAttr('data-popper-placement');
|
|
800
|
+
|
|
801
|
+
console.log('JAVIS: Mobile positioning applied successfully');
|
|
802
|
+
});
|
|
803
|
+
});
|
|
804
|
+
|
|
805
|
+
console.log('JAVIS: Mobile fix event listener attached');
|
|
806
|
+
}
|
|
807
|
+
|
|
731
808
|
/**
|
|
732
809
|
* Initialize immediate category filter navigation on feed page
|
|
733
810
|
* When a category is selected, navigate immediately instead of waiting for dropdown close
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{{{ if widgets.brand-header.length }}}
|
|
2
2
|
<div class="container-lg px-md-4 brand-container">
|
|
3
3
|
<div class="col-12 d-flex border-bottom pb-3 {{{ if config.theme.centerHeaderElements }}}justify-content-center{{{ end }}}">
|
|
4
|
+
<!-- Mobile Logo (only visible on mobile) -->
|
|
5
|
+
<div class="javis-mobile-header-logo d-none">
|
|
6
|
+
<a href="{relative_path}/" class="javis-mobile-logo-link" title="JAVIS Community">
|
|
7
|
+
<img src="{relative_path}/plugins/@okjavis/nodebb-theme-javis/static/images/logo-full.png" alt="JAVIS Community" class="javis-mobile-logo-img" />
|
|
8
|
+
</a>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
4
11
|
<!-- Search widget area (left/center) -->
|
|
5
12
|
<div data-widget-area="brand-header" class="flex-fill gap-3 p-2 align-self-center">
|
|
6
13
|
{{{each widgets.brand-header}}}
|