jquery/jquery-mobile — pull request #4411 by uGoMobi (2012-05-21 00:25:23+00:00)
Title: Fixes issue #2425: Set navbar buttons to the active state

Issue:

In the docs on the "Navbars" page is explained that you can add class ui-btn-active in the markup to give a navbar button the active state. Only at the "Persistent toolbars" page is mentioned that you need to add class ui-state-persist as well.
In fact you always need to add class ui-state-persist to make sure the button get the active state again on pageshow. Otherwise it only gets the active state again when the navbar is enhanced again, which does not happen if that page remains in the DOM.

Fix:

I added a function to the navbar widget that adds class ui-state-persist to anchor elements with class ui-btn-active during enhancement.
Additionally I changed the function that restores class ui-btn-active so it first removes this class from all navbar links. This is for the examples on the "Navbars" page which are not real links, so removing ui-btn-active upon succesful navigation does not happen.
In the docs I removed the info on the "Persistent toolbars" page about adding class ui-state-persist manually and I removed this class from the markup.

Fixes issue #2425