diff options
author | Igor Wiedler <igor@wiedler.ch> | 2012-02-08 19:38:21 +0100 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-03-31 02:09:24 +0200 |
commit | a12b7a5c64ba68bf98a161c41520546abce9fc81 (patch) | |
tree | 9bc116af477c930b487430709e03a696f90c20f2 /phpBB/assets/javascript | |
parent | d53c36684db5ee592b871f518364ae9de03d3e8b (diff) | |
download | forums-a12b7a5c64ba68bf98a161c41520546abce9fc81.tar forums-a12b7a5c64ba68bf98a161c41520546abce9fc81.tar.gz forums-a12b7a5c64ba68bf98a161c41520546abce9fc81.tar.bz2 forums-a12b7a5c64ba68bf98a161c41520546abce9fc81.tar.xz forums-a12b7a5c64ba68bf98a161c41520546abce9fc81.zip |
[feature/ajax] Fix alt_text and overlay closing
PHPBB3-10270
Diffstat (limited to 'phpBB/assets/javascript')
-rw-r--r-- | phpBB/assets/javascript/core.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 742aa05115..5088da65db 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -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'); + + e.preventDefault(); }); 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; fade.fadeOut(phpbb.alert_time, function() { div.hide(); }); callback(false); + + e.preventDefault(); }); 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 * current text so that the process can be repeated. */ -phpbb.add_ajax_callback('alt_text', function(el) { - el = $(el); - var alt_text = el.attr('data-alt-text'); +phpbb.add_ajax_callback('alt_text', function(data) { + var el = $(this), + alt_text; + + alt_text = el.attr('data-alt-text'); + el.text(); el.attr('data-alt-text', el.text()); el.text(el[0].title = alt_text); }); |