-
Notifications
You must be signed in to change notification settings - Fork 141
Add hover / blur callback events #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added hover and blur events to react on mouseover states.
Can you give ma an example what this fixes exactly? Perhaps with a demo fiddle (see #61)? |
It is not a fix but an enhancement. In my scenario in a selectmenu i have listed geometries which are drawn on a map like Google Maps for example. When you select an entry the correspondent geometry is selected but you will only notice which geometry it is when you have already selected one. With the suggested hover and blur event it would be possible to highlight these geometries on mouseover. I can imagine this would be helpful in several other cases or don't you think so? It would be only some lines of additional code. |
Ahh, ok thanks for the explanation. Seems legit to me. Why do you use public methods to fire the callbacks? |
What do you mean with public methods? The hover and blur methods are equivalent to your change or select methods. o you can declare the callback methods like this:
|
Functions without _ prefix are public. Please see: http://wiki.jqueryui.com/w/page/12138135/Widget%20factory So your hover and blur functions could be called by using myElement.selectmenu("blur").Why should this be possible? Afaics your current implementation would do nothing expect firing the callback. hint: try typing "m" when not in a textfield for textformatting options! |
made hover() and blur() methods private and added check for null value in _hover()
The methods can be private of course but why aren't your change and select method? I added the check for null in _hover() too. Do you think it is ok now? |
You are aware I only maintain this plugin as its original developed by filament group? Since then a bunch of people contributed and the code is everything but ot straight forward and clean. I'm just a guy who puts lot of his free time in this to keep this working until the official version is released, see #140 Change is public because its triggers a change event on the original select. I guess. Perhaps we should add your callbacks inline, without extra functions as they are really small. What do you think? Please update your branch! |
and removed unneeded check for null because the element at the index should actually be never null. otherwise it wouldn't be triggered
You need to merge your branch with my selectmenu branch, than pushing your branch to GitHub again. |
Sorry for the late response. Vacation time :-) |
I'm on vacation as well ;) I will do it when I am back. |
Added hover and blur events to react on mouseover states.