1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-09-10 00:01:29 +02:00

[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
This commit is contained in:
Vjacheslav Trushkin
2013-08-16 18:31:10 +03:00
parent 605cd0cafb
commit a92a3cfeb9
3 changed files with 7 additions and 30 deletions

View File

@@ -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>