From db7c4f938ec7440e40c2607fa18983f3a3a24146 Mon Sep 17 00:00:00 2001 From: Callum Macrae Date: Sun, 25 Sep 2011 16:49:43 +0100 Subject: [ticket/10270] Added close buttons to phpbb.alert and phpbb.confirm. PHPBB3-10270 --- phpBB/assets/javascript/core.js | 17 +++++++++++++++++ phpBB/styles/prosilver/template/overall_footer.html | 6 +++++- phpBB/styles/prosilver/theme/common.css | 6 ++++++ phpBB/styles/prosilver/theme/images/alert_close.png | Bin 0 -> 669 bytes 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 phpBB/styles/prosilver/theme/images/alert_close.png (limited to 'phpBB') diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index d685d28c81..667e3fc561 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -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() { diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index 362f8bc1cc..b7697afbb4 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -30,8 +30,12 @@

{L_LOADING}

{L_PLEASE_WAIT}

-

+
+ +

+
+

  diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index a3d2c5660e..0190ec7e85 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -603,6 +603,12 @@ li.pagination { padding: 0 25px 20px 25px; } +.jalert img.alert_close { + float: right; + margin-top: -7px; + margin-right: -30px; +} + .jalert p { margin: 8px 0; padding-bottom: 8px; diff --git a/phpBB/styles/prosilver/theme/images/alert_close.png b/phpBB/styles/prosilver/theme/images/alert_close.png new file mode 100644 index 0000000000..123ac4ac90 Binary files /dev/null and b/phpBB/styles/prosilver/theme/images/alert_close.png differ -- cgit v1.2.1