Panel: play nicely with multiple classnames for widgets (e.g. "olControlNavigationItemActive myClass")
|Reported by:||ejn||Owned by:|
|Keywords:||panel widget state||Cc:|
The current redraw method for Panel (more precisely, the methods iconOn and iconOff) change the class name on the icon using a regular expression which matches ItemInactive$ or ItemActive$ - i.e. at the end of the whole className string.
In cases where multiple class names are applied to the widgets this regex doesn't work - we need to be matching at end of word, not end of string - and so the widget state doesn't get updated.
Use case is e.g. to simplify CSS I wish to add a class "navigationWidget" to all controls on my panel, leaving them with a className string such as "olControlZoomBoxItemInactive navigationControl".
replace(/\b(olControl[^ ]*Item)Inactive\b/, "$1Active") replace(/\b(olControl[^ ]*Item)Active\b/, "$1Inactive")
The attached patch implements this change.