[ticket/10811] Fix AJAX callback alt_text so it can be repeated.

PHPBB3-10811
This commit is contained in:
Joas Schilling 2012-04-18 17:01:40 +02:00
parent de7a166a59
commit 286aebd93b

View file

@ -436,11 +436,12 @@ phpbb.add_ajax_callback = function(id, callback)
* the alt-text data attribute, and replaces the text in the attribute with the * the alt-text data attribute, and replaces the text in the attribute with the
* current text so that the process can be repeated. * current text so that the process can be repeated.
*/ */
phpbb.add_ajax_callback('alt_text', function(data) { phpbb.add_ajax_callback('alt_text', function() {
var el = $(this), var el = $(this),
alt_text; alt_text;
alt_text = el.attr('data-alt-text'); alt_text = el.attr('data-alt-text');
el.attr('data-alt-text', el.text());
el.attr('title', alt_text); el.attr('title', alt_text);
el.text(alt_text); el.text(alt_text);
}); });