From a92a3cfeb97e1d5e506252c09ae545d9382b6bda Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Fri, 16 Aug 2013 18:31:10 +0300 Subject: [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 --- phpBB/styles/prosilver/template/forum_fn.js | 5 +++++ .../prosilver/template/ucp_avatar_options_gravatar.html | 16 +--------------- .../prosilver/template/ucp_avatar_options_remote.html | 16 +--------------- 3 files changed, 7 insertions(+), 30 deletions(-) (limited to 'phpBB') 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 @@ - -

{L_GRAVATAR_AVATAR_EMAIL_EXPLAIN}
-
+

{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}
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 @@ - -

{L_LINK_REMOTE_AVATAR_EXPLAIN}
-
+

{L_LINK_REMOTE_SIZE_EXPLAIN}
-- cgit v1.2.1