Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add hover / blur callback events #262

Closed
wants to merge 3 commits into from

2 participants

@Peinkillar

Added hover and blur events to react on mouseover states.

@Peinkillar Peinkillar Update ui/jquery.ui.selectmenu.js
Added hover and blur events to react on mouseover states.
62c1c07
@fnagel
Owner

Can you give ma an example what this fixes exactly? Perhaps with a demo fiddle (see #61)?

@Peinkillar

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.

@fnagel
Owner

Ahh, ok thanks for the explanation. Seems legit to me.

Why do you use public methods to fire the callbacks?

@Peinkillar

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:

jQuery(this.featureSelect).selectmenu({
   ...,
  change: function () {},
  hover: function (e) {},
  blur: function (e) {}
});
@fnagel

No check for null here?

@fnagel
Owner

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!

@Peinkillar Peinkillar Update ui/jquery.ui.selectmenu.js
made hover() and blur() methods private and added check for null value in _hover()
194356b
@Peinkillar

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?

@fnagel
Owner

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.
Select is public because... good question. Should be private I guess. TODO

Perhaps we should add your callbacks inline, without extra functions as they are really small. What do you think?

Please update your branch!

@Peinkillar Peinkillar made blur and hover methods inline
and removed unneeded check for null because the element at the index
should actually be never null. otherwise it wouldn't be triggered
6b87f0a
@Peinkillar

Sorry about this commit with 882 additions and 892 deletions ... I am not familiar with github so far. Do I have to update my version first and how?

@fnagel
Owner

You need to merge your branch with my selectmenu branch, than pushing your branch to GitHub again.

@fnagel
Owner

Sorry for the late response. Vacation time :-)

@Peinkillar

I'm on vacation as well ;) I will do it when I am back.

@fnagel fnagel closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 28, 2012
  1. @Peinkillar

    Update ui/jquery.ui.selectmenu.js

    Peinkillar authored
    Added hover and blur events to react on mouseover states.
Commits on Sep 5, 2012
  1. @Peinkillar

    Update ui/jquery.ui.selectmenu.js

    Peinkillar authored
    made hover() and blur() methods private and added check for null value in _hover()
Commits on Sep 7, 2012
  1. @Peinkillar

    made blur and hover methods inline

    Peinkillar authored
    and removed unneeded check for null because the element at the index
    should actually be never null. otherwise it wouldn't be triggered
Something went wrong with that request. Please try again.