Closed
Bug 689878
Opened 14 years ago
Closed 14 years ago
Refactor the code in search.js as there are couple of loose global methods
Categories
(Firefox Graveyard :: Panorama, defect)
Firefox Graveyard
Panorama
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 10
People
(Reporter: raymondlee, Assigned: raymondlee)
Details
(Whiteboard: [fixed-in-fx-team])
Attachments
(1 file, 1 obsolete file)
|
47.12 KB,
patch
|
Details | Diff | Splinter Review |
There are some loose global methods e.g isSearchEnabled(), ensureSearchShown(), performSearch(). It would be nice to encapsulate them into an object.
| Assignee | ||
Updated•14 years ago
|
Assignee: nobody → raymond
Status: NEW → ASSIGNED
| Assignee | ||
Comment 1•14 years ago
|
||
No functions change, just refactor the search code.
Pushed to try
https://tbpl.mozilla.org/?tree=Try&rev=66dc0d227227
Attachment #563324 -
Flags: review?(ttaubert)
| Assignee | ||
Comment 2•14 years ago
|
||
Comment on attachment 563324 [details] [diff] [review]
v1
Passed Try
Comment 3•14 years ago
|
||
Comment on attachment 563324 [details] [diff] [review]
v1
Review of attachment 563324 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks, nice refactoring!
r=me with those few changes.
::: browser/base/content/tabview/search.js
@@ +99,5 @@
> // Function: focus
> // Given a <TabItem> or a <xul:tab>, focuses it and it's window.
> focus: function TabUtils_focus(tab) {
> // Convert a <TabItem> to a <xul:tab>
> + if (tab.tab != undefined)
Better: if ("tab" in tab).
@@ +528,5 @@
> + }
> + iQ(window).keydown(this._currentHandler);
> + },
> +
> + createSearchTabMacher: function Search_createSearchTabMacher() {
There is a "t" missing.
@@ +542,5 @@
> +
> + // ----------
> + // Function: hideSearch
> + // Hides search mode.
> + hideSearch: function Search_hideSearch(event) {
With "Search.init" I think that should be "Search.hide" only.
@@ +581,5 @@
> +
> + // ----------
> + // Function: performSearch
> + // Performs a search.
> + performSearch: function Search_performSearch() {
Same here, only "Search.perform".
@@ +598,5 @@
> + // Function: ensureSearchShown
> + // Ensures the search feature is displayed. If not, display it.
> + // Parameters:
> + // - a boolean indicates whether this is triggered by a keypress or not
> + ensureSearchShown: function Search_ensureSearchShown(activatedByKeypress) {
Maybe "ensureShown" only?
Attachment #563324 -
Flags: review?(ttaubert) → review+
| Assignee | ||
Comment 4•14 years ago
|
||
(In reply to Tim Taubert [:ttaubert] from comment #3)
>
> Review of attachment 563324 [details] [diff] [review] [diff] [details] [review]:
> -----------------------------------------------------------------
>
> Thanks, nice refactoring!
>
> r=me with those few changes.
>
> ::: browser/base/content/tabview/search.js
> @@ +99,5 @@
> > // Function: focus
> > // Given a <TabItem> or a <xul:tab>, focuses it and it's window.
> > focus: function TabUtils_focus(tab) {
> > // Convert a <TabItem> to a <xul:tab>
> > + if (tab.tab != undefined)
>
> Better: if ("tab" in tab).
Fixed
>
> @@ +528,5 @@
> > + }
> > + iQ(window).keydown(this._currentHandler);
> > + },
> > +
> > + createSearchTabMacher: function Search_createSearchTabMacher() {
>
> There is a "t" missing.
Fixed
>
> @@ +542,5 @@
> > +
> > + // ----------
> > + // Function: hideSearch
> > + // Hides search mode.
> > + hideSearch: function Search_hideSearch(event) {
>
> With "Search.init" I think that should be "Search.hide" only.
Updated
>
> @@ +581,5 @@
> > +
> > + // ----------
> > + // Function: performSearch
> > + // Performs a search.
> > + performSearch: function Search_performSearch() {
>
> Same here, only "Search.perform".
Updated
>
> @@ +598,5 @@
> > + // Function: ensureSearchShown
> > + // Ensures the search feature is displayed. If not, display it.
> > + // Parameters:
> > + // - a boolean indicates whether this is triggered by a keypress or not
> > + ensureSearchShown: function Search_ensureSearchShown(activatedByKeypress) {
>
> Maybe "ensureShown" only?
Yes, updated
Attachment #563324 -
Attachment is obsolete: true
| Assignee | ||
Comment 5•14 years ago
|
||
Comment on attachment 563652 [details] [diff] [review]
Patch for checkin
Pushed to try and waiting for results
https://tbpl.mozilla.org/?tree=Try&rev=d975b17ceb72
| Assignee | ||
Comment 6•14 years ago
|
||
(In reply to Raymond Lee [:raymondlee] from comment #5)
> Comment on attachment 563652 [details] [diff] [review] [diff] [details] [review]
> Patch for checkin
>
> Pushed to try and waiting for results
>
> https://tbpl.mozilla.org/?tree=Try&rev=d975b17ceb72
Passed Try. There are intermittents but not related to our code.
Keywords: checkin-needed
Comment 7•14 years ago
|
||
Keywords: checkin-needed
Whiteboard: [fixed-in-fx-team]
Comment 8•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 10
Updated•10 years ago
|
Product: Firefox → Firefox Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•