When a tab is selected, change the fragment id

[?]
Jun 24, 2013, 10:55 PM
ILEDGCVAFYW6UGYARTV65FJUYO2H2M57ENHMVH62ODY34H6QMPNQC

Dependencies

  • [2] OIBSCXGI Use a popover to show how to use the build reproduction script
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] GCHNNFZP

Change contents

  • edit in src/root/layout.tt at line 88
    [2.1210]
    [5.1601]
    /* Ensure that pressing the back button on another page
    navigates back to the previously selected tab on this
    page. */
    $(function() {
    $('.nav-tabs').bind('show', function(e) {
    var pattern = /#.+/gi;
    var id = e.target.toString().match(pattern)[0];
    history.replaceState(null, "", id);
    });
    });
    $(function() {
    if (window.location.hash) {
    $(".nav a[href='" + window.location.hash + "']").tab('show');
    }
    })