Opened 11 years ago
Closed 11 years ago
#11726 closed bug (invalid)
Changing button's data-theme programatically
Reported by: | Radek | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I am changing data-theme for a button dynamically from JS.
Procedure
- I have a button with theme "e"
- I change it to "a" via
$btn.attr("data-theme", "e")
- The button is still displayed in yellow, with the previous "e" theme
After that, I noticed the the generating <div> around the button contained both ui-btn-hover-e and ui-btn-up-e and their -a variants. It is also in case when I'm updating data-theme for the div.
So the workaround for me is to also remove the previous classes from the generated div:
$btn.closest("div").attr("data-theme", "e").removeClass("ui-btn-hover-a").removeClass("ui-btn-up-a");
Note: See
TracTickets for help on using
tickets.
You'd want to file a bug in the jQuery Mobile issue tracker, per the big red box here that says "ARE YOU IN THE RIGHT PLACE?" http://bugs.jquery.com