Skip to content

Selectmenu: Code review #492

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

Closed
wants to merge 292 commits into from
Closed

Selectmenu: Code review #492

wants to merge 292 commits into from

Conversation

fnagel
Copy link
Member

@fnagel fnagel commented Oct 10, 2011

Request for code review (in accordance with Jörn).

There some open issues being discussed, see the Wiki:
http://wiki.jqueryui.com/w/page/12138056/Selectmenu

}
},

_newelementEvents: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_newElementEvents?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Named that way because the events are bound to this.newelement. Variable names (this.list, this.newelement, etc.) are taken over from the old branch. The naming of the vars should be discussed anyway :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See here: #492 (comment)

@gnarf
Copy link
Member

gnarf commented Oct 10, 2011

I'm seeing a lot of uses of var that = this; where its not event needed. We are trying to avoid this wherever possible now...

Should probably just replace with this in most cases, as we clean up most of these, we can look at a better workaround for any cases left over.

// catch click event of the label
that._bind({
'click': function( event ) {
that.newelement.focus();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can just use this within a _bind callback. Should remove need for that inside _create completely.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also rename newelement to something like button or trigger. The latter would match what we have in Popup.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Ahh I did get that wrong. Will be changed soon.
  2. Agree, button seems legit. Should we change this.list to this.menu? I will change the wrapper var too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, pushed soon.

@jzaefferer
Copy link
Member

Nice: Showing 13 changed files with 1,000 additions and 0 deletions.

@fnagel
Copy link
Member Author

fnagel commented Dec 13, 2012

Let's clean up the visual tests. They are useful while prototyping, but need to be replaced by unit tests. Units are all there, so let's remove most of the visual tests, maybe merge one from each into a composite one.

Hey @jzaefferer, I know you want to get rid of the visual tests but they are very useful for testing issues and while developing. I've merged some again. Only three files left, hope thats ok.

@jzaefferer
Copy link
Member

Looking pretty good. Still need to ui-front and icons updates, pinged Scott about that. Also looking for @hanshillen to help with the aria tweaks. Once that is done, I'll rebase my branch and merge it in here.

@scottgonzalez
Copy link
Member

.ui-front implementation in autocomplete: 80e46c9

@fnagel
Copy link
Member Author

fnagel commented Dec 14, 2012

Thanks @scottgonzalez, I will take a look asap. For now, its "The Hobbit" time :-)


$.widget( "custom.iconselectmenu", $.ui.selectmenu, {
_renderItem: function( ul, item ) {
var li = $( "<li />" ).data( "ui-selectmenu-item", item );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no XML; use "<li>"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@jzaefferer
Copy link
Member

Closing this PR since notification emails mostly lead to "outdated diff", so nowhere and its generally just crazy long. Will create a new one from the same branch.

@jzaefferer jzaefferer closed this Dec 18, 2012
@jzaefferer jzaefferer mentioned this pull request Dec 18, 2012
@fnagel fnagel mentioned this pull request Jul 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

9 participants