diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2014-04-14 12:33:33 +0200 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2014-04-14 12:33:33 +0200 |
| commit | aebf2cc5cd5b76b3cc42b819dc446afb7cdbbad3 (patch) | |
| tree | 4bf2f4508035982faf946bb1136a76f689bc22c8 /phpBB/assets/javascript | |
| parent | 3ce479f061ce46ad8f1ac3c99a02459ff2b4b2d2 (diff) | |
| parent | fbeed2d975b4c080d3f391226b9b69b61f55aa23 (diff) | |
| download | forums-aebf2cc5cd5b76b3cc42b819dc446afb7cdbbad3.tar forums-aebf2cc5cd5b76b3cc42b819dc446afb7cdbbad3.tar.gz forums-aebf2cc5cd5b76b3cc42b819dc446afb7cdbbad3.tar.bz2 forums-aebf2cc5cd5b76b3cc42b819dc446afb7cdbbad3.tar.xz forums-aebf2cc5cd5b76b3cc42b819dc446afb7cdbbad3.zip | |
Merge remote-tracking branch 'marc/ticket/12372' into develop-ascraeus
* marc/ticket/12372:
[ticket/12372] Use $() instead of jQuery() in core.js for toggleDisplay
[ticket/12372] Use admin.js $(document).ready for hiding questionnaire details
[ticket/12372] Rename JS function dE() to phpbb.toggleDisplay()
[ticket/12372] Move dE() function core.js
[ticket/12372] Unify definition of function dE() across all files
[ticket/12372] Use jQuery in javascript dE() function
Diffstat (limited to 'phpBB/assets/javascript')
| -rw-r--r-- | phpBB/assets/javascript/core.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index ca62a5f649..ac866f7c78 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -1082,6 +1082,27 @@ phpbb.registerPalette = function(el) { } /** +* Set display of page element +* +* @param string id The ID of the element to change +* @param int action Set to 0 if element display should be toggled, -1 for +* hiding the element, and 1 for showing it. +* @param string type Display type that should be used, e.g. inline, block or +* other CSS "display" types +*/ +phpbb.toggleDisplay = function(id, action, type) { + if (!type) { + type = 'block'; + } + + var display = $('#' + id).css('display'); + if (!action) { + action = (display === '' || display === type) ? -1 : 1; + } + $('#' + id).css('display', ((action === 1) ? type : 'none')); +} + +/** * Apply code editor to all textarea elements with data-bbcode attribute */ $(document).ready(function() { |
