opitzconsulting / jquery-mobile-angular-adapter

jquery mobile angular adapter
MIT License
517 stars 114 forks source link

Header does not position buttons with ngm-if correctly #217

Open jupiterplanet opened 11 years ago

jupiterplanet commented 11 years ago

I have two left buttons in a header. Only one of the two buttons is shown at a time according to a condition. I use the class "ui-btn-left" to position them at the left side of the title as described under http://api.jquerymobile.com/header/ (Controlling button positions with classes).

However, it seems that the class ui-btn-right is added to the second button although it has the class ui-btn-left.

Here is a jsFiddle: http://jsfiddle.net/jupiter/qGQ9U/1/

tbosch commented 10 years ago

Hi, yes, jqm does not support changing button positions during run time. When the page is compiled jqm (not the adapter) detects two links (before the link phase) and adds ui-btn-left to the first and ui-btn-right to the second.

So instead of switching the button elements, you could use one button and change it's label and href on demand.