Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Change dialog label for Quick Open based on mode #2298

Merged
merged 8 commits into from
Dec 11, 2012
Merged

Conversation

njx
Copy link

@njx njx commented Dec 6, 2012

For #1705. Builds on @sagarsane's original pull request (#1706) to update the dialog label if the user changes the mode by editing the query string.

This ended up being a little complicated because we find out about changes to the query string through the _handleFilter callback to smart-autocomplete. This callback originally was just a module function, so didn't have the context of the dialog available. (We could have just directly looked up the ID in the global DOM, which other code in QuickOpen currently does, but it seems cleaner to actually look for it in the context of the dialog element.) So I changed this and some other related functions to be methods of QuickNavigateDialog instead.

sagarsane and others added 5 commits September 23, 2012 17:04
Added a switch case to set the dialogLabel correctly depending on which
Navigation option is chosen.
Added a switch case to set the dialogLabel correctly depending on which
Navigation option is chosen.
…er changes the first character. As part of this, changed some module functions so they're methods of QuickNavigateDialog instead, and added a module var to track the currently open dialog.
@ghost ghost assigned jasonsanjose Dec 7, 2012
@njx
Copy link
Author

njx commented Dec 11, 2012

@jasonsanjose - ping :)

@jasonsanjose
Copy link
Member

Oops, I missed this. I'll review today.

filter: _handleFilter,
resultFormatter: _handleResultsFormatter
filter: this._handleFilter,
resultFormatter: this._handleResultsFormatter
Copy link
Member

Choose a reason for hiding this comment

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

This use of this and that in showDialog() is a bit confusing now. On top of that, some of the event handlers are bound and others aren't: _handleItemSelect, _handleItemFocus, _handleKeyUp, _handleKeyDown, _handleResultsReady.

Also, just for consistency, I noticed _handleFilter and _handleResultsFormatter aren't wrapped in a wrapper function like the event handlers are. I'd actually prefer if we remove all the wrapper event handler functions (line 927-932) and change the signatures instead. It might be worth renaming _handleFilter and _handleResultsFormatter too since they aren't actually event handlers.

This is probably more refactoring than necessary, but I think at least we should fix the first issue with this/that and bind.

@jasonsanjose
Copy link
Member

Initial review complete

@njx
Copy link
Author

njx commented Dec 11, 2012

Code review changes pushed, merged with master. Ready for re-review.

@njx
Copy link
Author

njx commented Dec 11, 2012

BTW, this code definitely could use some overall cleanup, but I'm hesitant to do a bunch more without unit tests. We should probably do it at the point where we work on the "official" Quick Open card.

@jasonsanjose
Copy link
Member

Looks good. Merging.

jasonsanjose added a commit that referenced this pull request Dec 11, 2012
Change dialog label for Quick Open based on mode
@jasonsanjose jasonsanjose merged commit 0164820 into master Dec 11, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants