diff options
author | Marc Alexander <admin@m-a-styles.de> | 2012-12-16 00:57:53 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2012-12-16 00:57:53 +0100 |
commit | 46cc20452350a6ec8c02459216ff67e80be193d6 (patch) | |
tree | c8e8652fde6c59cf8e916f30a853ae8543be3b9a /phpBB/styles | |
parent | f4ff33536901d6019bfa4fc5e21b4bdafa66ac42 (diff) | |
download | forums-46cc20452350a6ec8c02459216ff67e80be193d6.tar forums-46cc20452350a6ec8c02459216ff67e80be193d6.tar.gz forums-46cc20452350a6ec8c02459216ff67e80be193d6.tar.bz2 forums-46cc20452350a6ec8c02459216ff67e80be193d6.tar.xz forums-46cc20452350a6ec8c02459216ff67e80be193d6.zip |
[ticket/10954] Use function for closing alert popup
PHPBB3-10954
Diffstat (limited to 'phpBB/styles')
-rw-r--r-- | phpBB/styles/prosilver/template/ajax.js | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index bbdb327e21..faf3e59998 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -2,6 +2,15 @@ "use strict"; +/** +* Close popup alert after a small delay +*/ +phpbb.closeDarkenWrapper = function() { + setTimeout(function() { + $('#darkenwrapper').trigger('click'); + }, 3000); +} + // This callback will mark all forum icons read phpbb.add_ajax_callback('mark_forums_read', function(res) { var readTitle = res.NO_UNREAD_POSTS; @@ -28,10 +37,7 @@ phpbb.add_ajax_callback('mark_forums_read', function(res) { $(this).attr('href', res.U_MARK_FORUMS); }); - // Hide alert after 3 seconds - setTimeout(function () { - $('#darkenwrapper').trigger('click'); - }, 3000); + phpbb.closeDarkenWrapper(); }); // This callback will mark all topic icons read @@ -85,10 +91,7 @@ phpbb.add_ajax_callback('mark_topics_read', function(res) { $(this).attr('href', res.U_MARK_TOPICS); }); - // Hide alert after 3 seconds - setTimeout(function () { - $('#darkenwrapper').trigger('click'); - }, 3000); + phpbb.closeDarkenWrapper(); }); // This callback finds the post from the delete link, and removes it. |