1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-28 04:20:32 +02:00

[ticket/12440] Set browser URL to point to specific post when using view=unread

PHPBB3-12440
This commit is contained in:
Cesar G
2014-05-05 15:08:18 -07:00
parent 324daf72fe
commit 7475e05f99
3 changed files with 19 additions and 3 deletions

View File

@@ -1425,6 +1425,20 @@ phpbb.getFunctionByName = function (functionName) {
return context[func];
};
/**
* Update browser history URL to point to specific post in viewtopic.php
* when using view=unread#unread link.
*
* @return undefined
*/
phpbb.setUnreadUrl = function() {
var url = $('#unread[data-url]').data('url');
if (url && typeof history !== 'undefined' && typeof history.replaceState !== 'undefined') {
history.replaceState(null, document.title, url);
}
};
/**
* Apply code editor to all textarea elements with data-bbcode attribute
*/
@@ -1444,6 +1458,8 @@ $(document).ready(function() {
$('#color_palette_placeholder').each(function() {
phpbb.registerPalette($(this));
});
phpbb.setUnreadUrl();
});
})(jQuery); // Avoid conflicts with other libraries