1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-28 12:30:42 +02:00

[ticket/10270] Added close buttons to phpbb.alert and phpbb.confirm.

PHPBB3-10270
This commit is contained in:
Callum Macrae
2011-09-25 16:49:43 +01:00
committed by Igor Wiedler
parent 0e55b2393d
commit db7c4f938e
4 changed files with 28 additions and 1 deletions

View File

@@ -68,6 +68,10 @@ phpbb.alert = function(title, msg, fadedark) {
}
return true;
});
div.find('.alert_close').one('click', function() {
dark.trigger('click');
});
if (loading_alert.is(':visible'))
{
@@ -115,6 +119,15 @@ phpbb.confirm = function(msg, callback, fadedark) {
callback(res);
return false;
});
dark.one('click', function(e) {
var fade = (typeof fadedark !== 'undefined' && !fadedark && res) ? div : dark;
fade.fadeOut(100, function() {
div.hide();
});
callback(false);
return false;
});
$(document).bind('keydown', function(e) {
if (e.keyCode === 13) {
@@ -127,6 +140,10 @@ phpbb.confirm = function(msg, callback, fadedark) {
return true;
});
div.find('.alert_close').one('click', function() {
dark.trigger('click');
});
if (loading_alert.is(':visible'))
{
loading_alert.fadeOut(100, function() {