This repository was archived by the owner on Oct 8, 2021. It is now read-only.
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
Changing button's data-theme programatically #4317
Closed
Description
Changing the data-theme attr. for buttons dynamically from JS seems to have some issues in version 1.1.0:
Procedure
- I have a button with theme "e"
- I change it to "a" via
$btn.attr("data-theme", "a")
- The button is still displayed in yellow, with the previous "e" theme
After that, I noticed the the generated div around the button contained both ui-btn-hover-e & ui-btn-up-e and also their (correct) -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", "a").removeClass("ui-btn-hover-e").removeClass("ui-btn-up-e");
Metadata
Metadata
Assignees
Labels
No labels