aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-06-27 18:26:44 +0200
committerIgor Wiedler <igor@wiedler.ch>2012-06-27 18:26:44 +0200
commitb060667ac102109c0c8f198925bb81b489a30f34 (patch)
treef6404ff9ee7e8b6f0761be61a4b86f1ed3f45e04
parent21df013210d1de2cffae568c0620a7ccd6d8f426 (diff)
downloadforums-b060667ac102109c0c8f198925bb81b489a30f34.tar
forums-b060667ac102109c0c8f198925bb81b489a30f34.tar.gz
forums-b060667ac102109c0c8f198925bb81b489a30f34.tar.bz2
forums-b060667ac102109c0c8f198925bb81b489a30f34.tar.xz
forums-b060667ac102109c0c8f198925bb81b489a30f34.zip
[feature/avatars] Rewrite avatars event handler to use jQuery
PHPBB3-10018
-rw-r--r--phpBB/adm/style/avatars.js16
-rw-r--r--phpBB/styles/prosilver/template/avatars.js16
2 files changed, 8 insertions, 24 deletions
diff --git a/phpBB/adm/style/avatars.js b/phpBB/adm/style/avatars.js
index baa2623ac9..252081ee08 100644
--- a/phpBB/adm/style/avatars.js
+++ b/phpBB/adm/style/avatars.js
@@ -1,17 +1,9 @@
function avatar_simplify() {
- var node = document.getElementById('av_options');
- for (var i = 0; i < node.children.length; i++) {
- child = node.children[i];
- child.style.display = 'none';
- }
+ $('#av_options').hide();
- var selected = document.getElementById('avatar_driver').value;
- var id = 'av_option_' + selected;
- node = document.getElementById(id);
- if (node != null) {
- node.style.display = 'block';
- }
+ var selected = $('#avatar_driver').val();
+ $('#av_option_' + selected).show();
}
avatar_simplify();
-document.getElementById('avatar_driver').onchange = avatar_simplify;
+$('#avatar_driver').on('change', avatar_simplify);
diff --git a/phpBB/styles/prosilver/template/avatars.js b/phpBB/styles/prosilver/template/avatars.js
index baa2623ac9..252081ee08 100644
--- a/phpBB/styles/prosilver/template/avatars.js
+++ b/phpBB/styles/prosilver/template/avatars.js
@@ -1,17 +1,9 @@
function avatar_simplify() {
- var node = document.getElementById('av_options');
- for (var i = 0; i < node.children.length; i++) {
- child = node.children[i];
- child.style.display = 'none';
- }
+ $('#av_options').hide();
- var selected = document.getElementById('avatar_driver').value;
- var id = 'av_option_' + selected;
- node = document.getElementById(id);
- if (node != null) {
- node.style.display = 'block';
- }
+ var selected = $('#avatar_driver').val();
+ $('#av_option_' + selected).show();
}
avatar_simplify();
-document.getElementById('avatar_driver').onchange = avatar_simplify;
+$('#avatar_driver').on('change', avatar_simplify);