Fixed tab menu history manipulation
authorAlexander Ebert <ebert@woltlab.com>
Tue, 14 May 2013 19:12:07 +0000 (21:12 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 14 May 2013 19:12:07 +0000 (21:12 +0200)
wcfsetup/install/files/js/WCF.js

index b666b3314d3c5719856c5dc210599b2ba27cc402..6c62c554fcdc4f678294a5c0daabdf50e78f932d 100755 (executable)
@@ -3317,7 +3317,12 @@ WCF.TabMenu = {
                                        
                                        // set panel id as location hash
                                        if (WCF.TabMenu._didInit) {
-                                               location.hash = '#' + $panel.attr('id');
+                                               if (window.history) {
+                                                       window.history.pushState(null, document.title, window.location.toString().replace(/#.+$/, '') + '#' + $panel.attr('id'));
+                                               }
+                                               else {
+                                                       location.hash = '#' + $panel.attr('id');
+                                               }
                                        }
                                        
                                        //$container.trigger('tabsbeforeactivate', event, eventData);