aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorVjacheslav Trushkin <cyberalien@gmail.com>2013-08-16 18:31:10 +0300
committerVjacheslav Trushkin <cyberalien@gmail.com>2013-09-14 10:10:42 +0300
commita92a3cfeb97e1d5e506252c09ae545d9382b6bda (patch)
treeb63ddc88a9200ea53f232ea873908f81876f589b /phpBB
parent605cd0cafb9cab5f64b1185965d1a354228181e7 (diff)
downloadforums-a92a3cfeb97e1d5e506252c09ae545d9382b6bda.tar
forums-a92a3cfeb97e1d5e506252c09ae545d9382b6bda.tar.gz
forums-a92a3cfeb97e1d5e506252c09ae545d9382b6bda.tar.bz2
forums-a92a3cfeb97e1d5e506252c09ae545d9382b6bda.tar.xz
forums-a92a3cfeb97e1d5e506252c09ae545d9382b6bda.zip
[ticket/11795] Use data-reset-on-edit attr to reset elements
Use data-reset-on-edit attribute to reset other inputs when editing input with data. Do not unbind event (old code unbound it after one use for no reason) PHPBB3-11795
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/styles/prosilver/template/forum_fn.js5
-rw-r--r--phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html16
-rw-r--r--phpBB/styles/prosilver/template/ucp_avatar_options_remote.html16
3 files changed, 7 insertions, 30 deletions
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js
index 49b3bc5dd9..59c4fd1d80 100644
--- a/phpBB/styles/prosilver/template/forum_fn.js
+++ b/phpBB/styles/prosilver/template/forum_fn.js
@@ -302,6 +302,11 @@ jQuery(document).ready(apply_onkeypress_event);
$('#' + this.getAttribute('data-focus')).focus();
});
+ // Reset avatar dimensions when changing URL or EMAIL
+ $('input[data-reset-on-edit]').bind('keyup', function() {
+ $(this.getAttribute('data-reset-on-edit')).val('');
+ });
+
// Adjust HTML code for IE8 and older versions
var test = document.createElement('div'),
oldBrowser = (typeof test.style.borderRadius == 'undefined');
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html b/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html
index 88e0e69f53..b1076c2d14 100644
--- a/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html
+++ b/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html
@@ -1,20 +1,6 @@
-<script type="text/javascript">
-// <![CDATA[
-
-onload_functions.push(function() {
- $('#avatar_gravatar_email').bind('keyup', function () {
- $('#avatar_gravatar_width').val('');
- $('#avatar_gravatar_height').val('');
- $('#avatar_gravatar_email').unbind('keyup');
- });
-});
-
-// ]]>
-</script>
-
<dl>
<dt><label for="avatar_gravatar_email">{L_GRAVATAR_AVATAR_EMAIL}{L_COLON}</label><br /><span>{L_GRAVATAR_AVATAR_EMAIL_EXPLAIN}</span></dt>
- <dd><input type="email" name="avatar_gravatar_email" id="avatar_gravatar_email" value="{AVATAR_GRAVATAR_EMAIL}" class="inputbox" /></dd>
+ <dd><input type="email" name="avatar_gravatar_email" id="avatar_gravatar_email" value="{AVATAR_GRAVATAR_EMAIL}" class="inputbox" data-reset-on-edit="#avatar_gravatar_width, #avatar_gravatar_height" /></dd>
</dl>
<dl>
<dt><label for="avatar_gravatar_width">{L_GRAVATAR_AVATAR_SIZE}{L_COLON}</label><br /><span>{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}</span></dt>
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html b/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html
index 59adf10058..a8f6135fb2 100644
--- a/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html
+++ b/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html
@@ -1,20 +1,6 @@
-<script type="text/javascript">
-// <![CDATA[
-
-onload_functions.push(function() {
- $('#avatar_remote_url').bind('keyup', function () {
- $('#avatar_remote_width').val('');
- $('#avatar_remote_height').val('');
- $('#avatar_remote_url').unbind('keyup');
- });
-});
-
-// ]]>
-</script>
-
<dl>
<dt><label for="avatar_remote_url">{L_LINK_REMOTE_AVATAR}{L_COLON}</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt>
- <dd><input type="url" name="avatar_remote_url" id="avatar_remote_url" value="{AVATAR_REMOTE_URL}" class="inputbox" /></dd>
+ <dd><input type="url" name="avatar_remote_url" id="avatar_remote_url" value="{AVATAR_REMOTE_URL}" class="inputbox" data-reset-on-edit="#avatar_remote_width, #avatar_remote_height" /></dd>
</dl>
<dl>
<dt><label for="avatar_remote_width">{L_LINK_REMOTE_SIZE}{L_COLON}</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>