[feature/ajax] Fix alt_text and overlay closing

PHPBB3-10270
This commit is contained in:
Igor Wiedler 2012-02-08 19:38:21 +01:00
parent d53c36684d
commit a12b7a5c64

View file

@ -84,8 +84,10 @@ phpbb.alert = function(title, msg, fadedark) {
} }
}); });
div.find('.alert_close').one('click', function() { div.find('.alert_close').one('click', function(e) {
dark.trigger('click'); dark.trigger('click');
e.preventDefault();
}); });
if (loading_alert.is(':visible')) if (loading_alert.is(':visible'))
@ -170,12 +172,14 @@ phpbb.confirm = function(msg, callback, fadedark) {
} }
}); });
div.find('.alert_close').one('click', function() { div.find('.alert_close').one('click', function(e) {
var fade = (typeof fadedark !== 'undefined' && fadedark) ? div : dark; var fade = (typeof fadedark !== 'undefined' && fadedark) ? div : dark;
fade.fadeOut(phpbb.alert_time, function() { fade.fadeOut(phpbb.alert_time, function() {
div.hide(); div.hide();
}); });
callback(false); callback(false);
e.preventDefault();
}); });
if (loading_alert.is(':visible')) if (loading_alert.is(':visible'))
@ -397,9 +401,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(el) { phpbb.add_ajax_callback('alt_text', function(data) {
el = $(el); var el = $(this),
var alt_text = el.attr('data-alt-text'); alt_text;
alt_text = el.attr('data-alt-text');
el.text();
el.attr('data-alt-text', el.text()); el.attr('data-alt-text', el.text());
el.text(el[0].title = alt_text); el.text(el[0].title = alt_text);
}); });