diff options
author | Marc Alexander <admin@m-a-styles.de> | 2013-02-27 21:40:02 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2013-02-27 21:40:02 +0100 |
commit | 96b1cabcf2fbc4955bab65a4931f1815548d4df4 (patch) | |
tree | 16e869447ba1560109604402449c57052ea33d06 /phpBB/styles/prosilver/template/ajax.js | |
parent | 2f6b072bb13ce9d7c7784136bedec651b73ae11b (diff) | |
parent | 80bd78a5e5e1069773c05073cd47662a311bda79 (diff) | |
download | forums-96b1cabcf2fbc4955bab65a4931f1815548d4df4.tar forums-96b1cabcf2fbc4955bab65a4931f1815548d4df4.tar.gz forums-96b1cabcf2fbc4955bab65a4931f1815548d4df4.tar.bz2 forums-96b1cabcf2fbc4955bab65a4931f1815548d4df4.tar.xz forums-96b1cabcf2fbc4955bab65a4931f1815548d4df4.zip |
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into ticket/11314
Diffstat (limited to 'phpBB/styles/prosilver/template/ajax.js')
-rw-r--r-- | phpBB/styles/prosilver/template/ajax.js | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index 771981b3e3..e38e3d4cb2 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -37,14 +37,24 @@ phpbb.addAjaxCallback('mark_forums_read', function(res) { // Mark subforums read $('a.subforum[class*="unread"]').removeClass('unread').addClass('read'); + // Mark topics read if we are watching a category and showing active topics + if ($('#active_topics').length) { + phpbb.ajaxCallbacks['mark_topics_read'].call(this, res, false); + } + // Update mark forums read links $('[data-ajax="mark_forums_read"]').attr('href', res.U_MARK_FORUMS); phpbb.closeDarkenWrapper(3000); }); -// This callback will mark all topic icons read -phpbb.addAjaxCallback('mark_topics_read', function(res) { +/** +* This callback will mark all topic icons read +* +* @param update_topic_links bool Wether "Mark topics read" links should be +* updated. Defaults to true. +*/ +phpbb.addAjaxCallback('mark_topics_read', function(res, update_topic_links) { var readTitle = res.NO_UNREAD_POSTS; var unreadTitle = res.UNREAD_POSTS; var iconsArray = { @@ -58,6 +68,10 @@ phpbb.addAjaxCallback('mark_topics_read', function(res) { var classMap = {}; var classNames = []; + if (typeof update_topic_links === 'undefined') { + update_topic_links = true; + } + $.each(iconsArray, function(unreadClass, readClass) { $.each(iconsState, function(key, value) { // Only topics can be hot @@ -85,7 +99,9 @@ phpbb.addAjaxCallback('mark_topics_read', function(res) { $('a').has('span.icon_topic_newest').remove(); // Update mark topics read links - $('[data-ajax="mark_topics_read"]').attr('href', res.U_MARK_TOPICS); + if (update_topic_links) { + $('[data-ajax="mark_topics_read"]').attr('href', res.U_MARK_TOPICS); + } phpbb.closeDarkenWrapper(3000); }); @@ -193,6 +209,21 @@ $('#quick-mod-select').change(function () { $('#quickmodform').submit(); }); - +/** +* Toggle the member search panel in memberlist.php. +* +* If user returns to search page after viewing results the search panel is automatically displayed. +* In any case the link will toggle the display status of the search panel and link text will be +* appropriately changed based on the status of the search panel. +*/ +$('#member_search').click(function () { + $('#memberlist_search').slideToggle('fast'); + phpbb.ajax_callbacks['alt_text'].call(this); + // Focus on the username textbox if it's available and displayed + if ($('#memberlist_search').is(':visible')) { + $('#username').focus(); + } + return false; +}); })(jQuery); // Avoid conflicts with other libraries |