Closed Bug 1405063 Opened 7 years ago Closed 7 years ago

Adding a tab in the TabBar should be able to take an index to specify where to add the tab

Categories

(DevTools :: Framework, enhancement, P3)

enhancement

Tracking

(firefox58 fixed)

RESOLVED FIXED
Firefox 58
Tracking Status
firefox58 --- fixed

People

(Reporter: gl, Assigned: gl)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The ToolSidebar and TabBar should be able to take an index to specify where in the TabBar the new tab can be added. 

I have an use case where I am pushing and popping out the Rules view in Bug 1369945 to create a 3 pane inspector view. I need to be able to specify an index when adding a tab so that the Rules view can be inserted back to be the first tab in the ToolSidebar in the Inspector.
Blocks: 1369945
Comment on attachment 8914443 [details]
Bug 1405063 - Adding a tab in the TabBar should be able to take an index to specify where to add the tab.

https://reviewboard.mozilla.org/r/185756/#review191074

Looks reasonable, thanks!

R+ assuming try is green and my comment is resolved.

Honza

::: devtools/client/shared/components/tabs/TabBar.js:82
(Diff revision 1)
>    },
>  
>    // Public API
>  
> -  addTab: function (id, title, selected = false, panel, url) {
> +  addTab: function (id, title, selected = false, panel, url, index) {
>      let tabs = this.state.tabs.slice();

We can provide default -1 for the index argument.
Attachment #8914443 - Flags: review?(odvarko) → review+
Pushed by gabriel.luong@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/bfde202ada8a
Adding a tab in the TabBar should be able to take an index to specify where to add the tab. r=honza
https://hg.mozilla.org/mozilla-central/rev/bfde202ada8a
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Blocks: 1433716
No longer blocks: 1369945
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: