1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-30 11:40:08 +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_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>