aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2014-04-07 20:43:32 +0200
committerMarc Alexander <admin@m-a-styles.de>2014-04-07 20:43:32 +0200
commitad98a070c37a66f773851851888f7e98dc447d92 (patch)
tree32093a5ad1feb804baaf4f852519bd9af658ce2a
parent385420c8f5697b1978ebd1bdfcd138d5ce88b98a (diff)
downloadforums-ad98a070c37a66f773851851888f7e98dc447d92.tar
forums-ad98a070c37a66f773851851888f7e98dc447d92.tar.gz
forums-ad98a070c37a66f773851851888f7e98dc447d92.tar.bz2
forums-ad98a070c37a66f773851851888f7e98dc447d92.tar.xz
forums-ad98a070c37a66f773851851888f7e98dc447d92.zip
[ticket/12372] Unify definition of function dE() across all files
PHPBB3-12372
-rw-r--r--phpBB/adm/style/install_header.html22
-rw-r--r--phpBB/adm/style/overall_header.html22
-rw-r--r--phpBB/adm/style/simple_header.html22
-rw-r--r--phpBB/styles/subsilver2/template/ucp_prefs_personal.html23
4 files changed, 51 insertions, 38 deletions
diff --git a/phpBB/adm/style/install_header.html b/phpBB/adm/style/install_header.html
index 99b98ef068..4980fd36fb 100644
--- a/phpBB/adm/style/install_header.html
+++ b/phpBB/adm/style/install_header.html
@@ -13,21 +13,23 @@
/**
* Set display of page element
-* s[-1,0,1] = hide,toggle display,show
+*
+* @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)
-{
- if (!type)
- {
+function dE(id, action, type) {
+ if (!type) {
type = 'block';
}
- var e = document.getElementById(n);
- if (!s)
- {
- s = (e.style.display == '' || e.style.display == 'block') ? -1 : 1;
+ var display = jQuery('#' + id).css('display');
+ if (!action) {
+ action = (display === '' || display === type) ? -1 : 1;
}
- e.style.display = (s == 1) ? type : 'none';
+ jQuery('#' + id).css('display', ((action === 1) ? type : 'none'));
}
// ]]>
diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html
index 7e7f0cecee..668c0f4e92 100644
--- a/phpBB/adm/style/overall_header.html
+++ b/phpBB/adm/style/overall_header.html
@@ -37,21 +37,23 @@ function jumpto()
/**
* Set display of page element
-* s[-1,0,1] = hide,toggle display,show
+*
+* @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)
-{
- if (!type)
- {
+function dE(id, action, type) {
+ if (!type) {
type = 'block';
}
- var e = document.getElementById(n);
- if (!s)
- {
- s = (e.style.display == '') ? -1 : 1;
+ var display = jQuery('#' + id).css('display');
+ if (!action) {
+ action = (display === '' || display === type) ? -1 : 1;
}
- e.style.display = (s == 1) ? type : 'none';
+ jQuery('#' + id).css('display', ((action === 1) ? type : 'none'));
}
/**
diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html
index 770b7da8a6..01757f1032 100644
--- a/phpBB/adm/style/simple_header.html
+++ b/phpBB/adm/style/simple_header.html
@@ -50,21 +50,23 @@ function jumpto()
/**
* Set display of page element
-* s[-1,0,1] = hide,toggle display,show
+*
+* @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)
-{
- if (!type)
- {
+function dE(id, action, type) {
+ if (!type) {
type = 'block';
}
- var e = document.getElementById(n);
- if (!s)
- {
- s = (e.style.display == '') ? -1 : 1;
+ var display = jQuery('#' + id).css('display');
+ if (!action) {
+ action = (display === '' || display === type) ? -1 : 1;
}
- e.style.display = (s == 1) ? type : 'none';
+ jQuery('#' + id).css('display', ((action === 1) ? type : 'none'));
}
/**
diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
index cd5fc9a13f..3499f5ef9a 100644
--- a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
+++ b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
@@ -4,16 +4,23 @@
// <![CDATA[
/**
* Set display of page element
- * s[-1,0,1] = hide,toggle display,show
+ *
+ * @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)
- {
- var e = document.getElementById(n);
- if (!s)
- {
- s = (e.style.display == '') ? -1 : 1;
+ function dE(id, action, type) {
+ if (!type) {
+ type = 'block';
}
- e.style.display = (s == 1) ? 'block' : 'none';
+
+ var display = jQuery('#' + id).css('display');
+ if (!action) {
+ action = (display === '' || display === type) ? -1 : 1;
+ }
+ jQuery('#' + id).css('display', ((action === 1) ? type : 'none'));
}
var default_dateformat = '{A_DEFAULT_DATEFORMAT}';