nodebb-theme-persona 11.2.20 → 11.3.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-theme-persona",
3
- "version": "11.2.20",
3
+ "version": "11.3.1",
4
4
  "nbbpm": {
5
5
  "compatibility": "^1.18.0"
6
6
  },
package/public/persona.js CHANGED
@@ -23,11 +23,23 @@ $(document).ready(function () {
23
23
 
24
24
  function fixHeaderPadding() {
25
25
  var env = utils.findBootstrapEnvironment();
26
- if (env === 'sm' || env === 'xs' || env === 'md') {
27
- $('#panel').css('padding-top', $('#header-menu').outerHeight(true));
28
- } else {
29
- $('#panel').css('padding-top', $('#header-menu').outerHeight(true) - 70);
26
+ const headerEl = document.getElementById('header-menu');
27
+ const panelEl = document.getElementById('panel');
28
+
29
+ if (!headerEl || !panelEl) {
30
+ return;
31
+ }
32
+
33
+ const headerRect = headerEl.getBoundingClientRect();
34
+ const headerStyle = window.getComputedStyle(headerEl);
35
+
36
+ let paddingTop = headerRect.y + headerRect.height + (parseInt(headerStyle.marginTop, 10) || 0) + (parseInt(headerStyle.marginBottom, 10) || 0);
37
+ // body element itself introduces a hardcoded 70px padding on desktop resolution
38
+ if (env === 'lg') {
39
+ paddingTop -= 70;
30
40
  }
41
+
42
+ panelEl.style.paddingTop = `${paddingTop}px`;
31
43
  }
32
44
 
33
45
  var lastBSEnv = '';
@@ -202,16 +202,24 @@
202
202
  <ul id="main-nav" class="nav navbar-nav">
203
203
  {{{each navigation}}}
204
204
  <!-- IF function.displayMenuItem, @index -->
205
- <li class="{navigation.class}">
206
- <a class="navigation-link" href="{navigation.route}" title="{navigation.title}" <!-- IF navigation.id -->id="{navigation.id}"<!-- ENDIF navigation.id --><!-- IF navigation.properties.targetBlank --> target="_blank"<!-- ENDIF navigation.properties.targetBlank -->>
207
- <!-- IF navigation.iconClass -->
205
+ <li class="{navigation.class}{{{ if navigation.dropdown }}} dropdown{{{ end }}}">
206
+ <a title="{navigation.title}" class="navigation-link {{{ if navigation.dropdown }}}dropdown-toggle{{{ end }}}"
207
+ {{{ if navigation.dropdown }}} href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" {{{ else }}} href="{navigation.route}"{{{ end }}} {{{ if navigation.id }}}id="{navigation.id}"{{{ end }}}{{{ if navigation.properties.targetBlank }}} target="_blank"{{{ end }}}>
208
+ {{{ if navigation.iconClass }}}
208
209
  <i class="fa fa-fw {navigation.iconClass}" data-content="{navigation.content}"></i>
209
- <!-- ENDIF navigation.iconClass -->
210
-
211
- <!-- IF navigation.text -->
210
+ {{{ end }}}
211
+ {{{ if navigation.text }}}
212
212
  <span class="{navigation.textClass}">{navigation.text}</span>
213
- <!-- ENDIF navigation.text -->
213
+ {{{ end }}}
214
+ {{{ if navigation.dropdown}}}
215
+ <i class="fa fa-caret-down"></i>
216
+ {{{ end }}}
214
217
  </a>
218
+ {{{ if navigation.dropdown }}}
219
+ <ul class="dropdown-menu">
220
+ {navigation.dropdownContent}
221
+ </ul>
222
+ {{{ end }}}
215
223
  </li>
216
224
  <!-- ENDIF function.displayMenuItem -->
217
225
  {{{end}}}
@@ -67,7 +67,7 @@
67
67
 
68
68
  <!-- IMPORT partials/topic/post.tpl -->
69
69
  </li>
70
- {renderTopicEvents(@index)}
70
+ {renderTopicEvents(@index, config.topicPostSort)}
71
71
  {{{end}}}
72
72
  </ul>
73
73