Global click/resize events instead of binding once for each widget #180

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

thg2k commented Oct 18, 2011

Use global click/resize events instead of binding once for each widget in the page
Check out this change I mentioned in #177

Owner

fnagel commented Oct 20, 2011

Seems like a pretty good idea. I will compare this to the implementation of the new version (see #140) and we'll see whats best.

Thanks a lot for your enduring contribution!

Owner

fnagel commented Jan 16, 2012

Sorry for the late response. Would you mind test the latest commit and eventually update your branch if needed?

thg2k commented Jan 17, 2012

Hi fnagel! Sorry for the prolonged silence, I was busy with other areas so I had no time to go back to the widgets part with my mind.
I'll test it soon and let you know.
Can you tell me what you did wrt this issue? Did you merge my patch or use a similar solution?

Owner

fnagel commented Jan 18, 2012

I did not adapt your changes as Im not quite sure if I did understand your
changes. Perhaps you could explain the existing pull request by commenting
it.

@thg2k thg2k commented on the diff Jan 18, 2012

ui/jquery.ui.selectmenu.js
@@ -150,11 +162,6 @@ $.widget("ui.selectmenu", {
}
});
- // document click closes menu
- $(document).bind("mousedown.selectmenu-" + this.ids[0], function(event) {
- self.close(event);
@thg2k

thg2k Jan 18, 2012

add here something like console.log("i'm closing myself"); to see what happens

thg2k commented Jan 18, 2012

i'll try with a brief explanation..in the current way (didn't check if you changed it though) you bind a separate event to the $(document) node one for each converted to widget. In my website pages have usually 3, 4 or even 5 select boxes usually, some many more. This ends up with a lot of events triggering for each mouse down in my document. With my change the first converted to trigger binds a generic static event which closes any open select, so even if you have 5 select boxes there is only one execution triggered on mouse down, but the effect will be useful for any open select menu.
this patch is currently applied in my production website and it's working properly, but if you are willing to merge it i will merge again with your repo (my last production merge was many months ago) and test again!

Owner

fnagel commented Nov 24, 2012

Sorry for the delay. I found some time and took a look at your patches. I adapted your changes but I was not able to get this working. Any suggestions?

Owner

fnagel commented Jan 17, 2013

Any feedback on this issue?

Are you aware that the upcoming jQuery UI release will hopefully include the new, built from scratch version of jQuery UI Selectmenu? See https://github.com/jquery/jquery-ui/tree/selectmenu

Owner

fnagel commented May 29, 2013

Any feedback on this PR?

pdias commented May 29, 2013

Hello,

Probably is related to this problem, a selectmenu in a dialog does not close the list when clicking outside the list...

Thanks,

Paulo

Owner

fnagel commented May 29, 2013

Seems reasonable. Should check this again.

Reference: #293

pdias commented May 29, 2013

Thanks, i check reference #293... I applied the fix ... and now everything works fine.

thank you,

Owner

fnagel commented Sep 7, 2013

Closed, please reopen if needed.

fnagel closed this Sep 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment