softwaretailoring / wheelnav

Animated wheel navigation JavaScript library based on Raphaël.js (SVG/VML). It can be a pie menu (radial menu, circular menu) and many more.
https://wheelnavjs.softwaretailoring.net
MIT License
702 stars 101 forks source link

Change dynamically the text of the navTitle #26

Closed KentriLuigi closed 8 years ago

KentriLuigi commented 8 years ago

I would like to show the different language available when i select the region. For exemple :

I have two buttons

In the same wheelnav i would like to refresh (without recreate a wheelnav) the title with the choices of the clicked button.

I try something like that :

for (var indexTitle = 0; indexTitle <  radianMenu.navItems.length; indexTitle++) {
       radianMenu.navItems[indexTitle].title = region.choice;
       radianMenu.navItems[indexTitle].titleHover = region.choice;
       radianMenu.navItems[indexTitle].titleSelected = region.choice;
}

It works but i think is not the best pratice. What do you think about it ?

softwaretailoring commented 8 years ago

You're right. There should be a setter method for this case.

And now it is here. :)

radianMenu.navItems[indexTitle].setTitle(region.choice);

I'm curious about your wheel. It will be available on the web?