mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/12372] Use jQuery in javascript dE() function
PHPBB3-12372
This commit is contained in:
parent
f0176b5393
commit
385420c8f5
1 changed files with 11 additions and 7 deletions
|
@ -93,19 +93,23 @@ function viewableArea(e, itself) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set display of page element
|
* Set display of page element
|
||||||
* s[-1,0,1] = hide,toggle display,show
|
*
|
||||||
* type = string: inline, block, inline-block or other CSS "display" type
|
* @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
|
||||||
*/
|
*/
|
||||||
function dE(n, s, type) {
|
function dE(id, action, type) {
|
||||||
if (!type) {
|
if (!type) {
|
||||||
type = 'block';
|
type = 'block';
|
||||||
}
|
}
|
||||||
|
|
||||||
var e = document.getElementById(n);
|
var display = jQuery('#' + id).css('display');
|
||||||
if (!s) {
|
if (!action) {
|
||||||
s = (e.style.display === '' || e.style.display === type) ? -1 : 1;
|
action = (display === '' || display === type) ? -1 : 1;
|
||||||
}
|
}
|
||||||
e.style.display = (s === 1) ? type : 'none';
|
jQuery('#' + id).css('display', ((action === 1) ? type : 'none'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue