[ticket/11563] Dynamically generate panels list

PHPBB3-11563
This commit is contained in:
Vjacheslav Trushkin 2013-07-11 10:58:18 -04:00
parent 6599cabed7
commit a9259b12aa
3 changed files with 6 additions and 3 deletions

View file

@ -109,7 +109,10 @@ function dE(n, s, type) {
jQuery(document).ready(function() {
jQuery('.sub-panels').each(function() {
var panels = this.getAttribute('data-panels').split(','),
var panels = [],
childNodes = jQuery('a[data-subpanel]', this).each(function() {
panels.push(this.getAttribute('data-subpanel'));
}),
show_panel = this.getAttribute('data-show-panel');
if (panels.length) {

View file

@ -11,7 +11,7 @@
<!-- DEFINE $SHOW_PANEL = 'display-panel' -->
<!-- ENDIF -->
<div id="minitabs" class="sub-panels" data-show-panel="{$SHOW_PANEL}" data-panels="display-panel,split-panel,merge-panel">
<div id="minitabs" class="sub-panels" data-show-panel="{$SHOW_PANEL}">
<ul>
<li id="display-panel-tab"<!-- IF not S_MERGE_VIEW --> class="activetab"<!-- ENDIF -->>
<a href="#minitabs" data-subpanel="display-panel"><span>{L_DISPLAY_OPTIONS}</span></a>

View file

@ -193,7 +193,7 @@
<!-- ENDIF -->
<!-- IF not S_PRIVMSGS and not S_SHOW_DRAFTS and not $SIG_EDIT eq 1 -->
<div id="tabs" class="sub-panels" data-show-panel="options-panel" data-panels="options-panel,attach-panel,poll-panel">
<div id="tabs" class="sub-panels" data-show-panel="options-panel">
<ul>
<li id="options-panel-tab" class="activetab"><a href="#tabs" data-subpanel="options-panel"><span>{L_OPTIONS}</span></a></li>
<!-- IF S_SHOW_ATTACH_BOX --><li id="attach-panel-tab"><a href="#tabs" data-subpanel="attach-panel"><span>{L_ADD_ATTACHMENT}</span></a></li><!-- ENDIF -->