diff options
author | Cesar G <prototech91@gmail.com> | 2014-06-04 23:07:02 -0700 |
---|---|---|
committer | Cesar G <prototech91@gmail.com> | 2014-06-04 23:07:02 -0700 |
commit | 49c875413ca2fd1cc438ce42c64e0a00a5044e56 (patch) | |
tree | 933fe162b8d86107db7c8fc002e066d8904d0b89 /phpBB/styles/prosilver/template/forum_fn.js | |
parent | e67a19a940291887cfc940175b3485646c37cd95 (diff) | |
parent | 082a6b29a96ad57ec53e72c9c2b57d919d457d49 (diff) | |
download | forums-49c875413ca2fd1cc438ce42c64e0a00a5044e56.tar forums-49c875413ca2fd1cc438ce42c64e0a00a5044e56.tar.gz forums-49c875413ca2fd1cc438ce42c64e0a00a5044e56.tar.bz2 forums-49c875413ca2fd1cc438ce42c64e0a00a5044e56.tar.xz forums-49c875413ca2fd1cc438ce42c64e0a00a5044e56.zip |
Merge remote-tracking branch 'PayBas/ticket/12541' into develop-ascraeus
* PayBas/ticket/12541:
[ticket/12541] Activate attachments tab when files are dropped into textarea
Conflicts:
phpBB/styles/prosilver/template/forum_fn.js
Diffstat (limited to 'phpBB/styles/prosilver/template/forum_fn.js')
-rw-r--r-- | phpBB/styles/prosilver/template/forum_fn.js | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index ef7ca23ef4..fa838fde19 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -104,28 +104,38 @@ jQuery(document).ready(function() { show_panel = this.getAttribute('data-show-panel'); if (panels.length) { - subPanels(show_panel); + activateSubPanel(show_panel, panels); childNodes.click(function () { - subPanels(this.getAttribute('data-subpanel')); + activateSubPanel(this.getAttribute('data-subpanel'), panels); return false; }); } + }); +}); - function subPanels(p) { - var i; +/** +* Activate specific subPanel +*/ +function activateSubPanel(p, panels) { + var i; - if (typeof(p) === 'string') { - show_panel = p; - } - $('input[name="show_panel"]').val(show_panel); + if (typeof(p) === 'string') { + show_panel = p; + } + $('input[name="show_panel"]').val(show_panel); - for (i = 0; i < panels.length; i++) { - jQuery('#' + panels[i]).css('display', panels[i] === show_panel ? 'block' : 'none'); - jQuery('#' + panels[i] + '-tab').toggleClass('activetab', panels[i] === show_panel); - } - } - }); -}); + if (typeof(panels) === 'undefined') { + panels = []; + jQuery('.sub-panels a[data-subpanel]').each(function() { + panels.push(this.getAttribute('data-subpanel')); + }); + } + + for (i = 0; i < panels.length; i++) { + jQuery('#' + panels[i]).css('display', panels[i] === show_panel ? 'block' : 'none'); + jQuery('#' + panels[i] + '-tab').toggleClass('activetab', panels[i] === show_panel); + } +} /** * Call print preview |