aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/assets
diff options
context:
space:
mode:
authorCesar G <prototech91@gmail.com>2014-05-05 15:08:18 -0700
committerCesar G <prototech91@gmail.com>2014-05-05 16:33:27 -0700
commit7475e05f997c780c07111681a78d510930ad2e9a (patch)
treeb1071f5f2b7a588f4493dd28941b7fc07eadd0a0 /phpBB/assets
parent324daf72fec829a4a937879ef0615829443114cc (diff)
downloadforums-7475e05f997c780c07111681a78d510930ad2e9a.tar
forums-7475e05f997c780c07111681a78d510930ad2e9a.tar.gz
forums-7475e05f997c780c07111681a78d510930ad2e9a.tar.bz2
forums-7475e05f997c780c07111681a78d510930ad2e9a.tar.xz
forums-7475e05f997c780c07111681a78d510930ad2e9a.zip
[ticket/12440] Set browser URL to point to specific post when using view=unread
PHPBB3-12440
Diffstat (limited to 'phpBB/assets')
-rw-r--r--phpBB/assets/javascript/core.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index f461d5a175..0b46a1e937 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -1426,6 +1426,20 @@ phpbb.getFunctionByName = function (functionName) {
};
/**
+* 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
*/
$(document).ready(function() {
@@ -1444,6 +1458,8 @@ $(document).ready(function() {
$('#color_palette_placeholder').each(function() {
phpbb.registerPalette($(this));
});
+
+ phpbb.setUnreadUrl();
});
})(jQuery); // Avoid conflicts with other libraries