[de-xbl] convert the tabmail-close-tab-button binding
Categories
(Thunderbird :: Mail Window Front End, task)
Tracking
(Not tracked)
People
(Reporter: mkmelin, Assigned: aleca)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
Convert the tabmail-close-tab-button binding, which extends toolbarbutton.
Might also be worth looking at what firefox dis for their button.
Assignee | ||
Comment 1•5 years ago
|
||
If I got it right, Firefox is using this method to deal with tabs and windows: https://searchfox.org/mozilla-central/source/browser/base/content/browser.js#2562
We have a similar method here: https://searchfox.org/comm-central/source/mail/base/content/mail3PaneWindowCommands.js#1107
I tried to leverage it but it doesn't work as expected, closing random tabs, or not responding at all.
I created a new method converting the XBL method to keep those conditions.
Reporter | ||
Comment 3•5 years ago
|
||
Comment on attachment 9067206 [details] [diff] [review] tabmail-close-tab-button.patch Review of attachment 9067206 [details] [diff] [review]: ----------------------------------------------------------------- While this works, maybe we should take the opportunity to make it just an image, like firefox https://searchfox.org/mozilla-central/rev/662de518b1686c4769320d6b8825ce4864c4eda0/browser/base/content/tabbrowser.xml#1955 ::: mail/base/content/mail3PaneWindowCommands.js @@ +1114,4 @@ > } > } > > +function CloseCurrentTab(event, button) { the name is slightly wrong, as it it's not necessarily current tab - it's the one whose button you clicked
Assignee | ||
Comment 4•5 years ago
|
||
If I'm not wrong, FF uses only an image because it catches clicks with an XBL handler: https://searchfox.org/mozilla-central/rev/662de518b1686c4769320d6b8825ce4864c4eda0/browser/base/content/tabbrowser.xml#2396
Do we want to emulate the same behaviour?
Or maybe we could use the occasion to de-xbl the entire tab?
Reporter | ||
Comment 5•5 years ago
|
||
de-xbl of the whole tab should probably wait for de-xbl of tab.
I think you could just add an oncommand="closeTab(event);" on the image?
Assignee | ||
Comment 6•5 years ago
|
||
Sounds good.
The oncommand
attribute doesn't work since it's not a button.
Using onclick
works.
Reporter | ||
Comment 7•5 years ago
|
||
Comment on attachment 9067414 [details] [diff] [review] tabmail-close-tab-button.patch Review of attachment 9067414 [details] [diff] [review]: ----------------------------------------------------------------- Sorry I think I gave the wrong advice :( I don't think we want to move this functionality to mail3PaneWIndowCommands.js - it should stay in tabmail.xml so that that functionality is confined. Indeed, you could add the function to the tabmail-tab instead (similar to firefox).
Assignee | ||
Comment 8•5 years ago
|
||
Reporter | ||
Comment 9•5 years ago
|
||
Comment on attachment 9067478 [details] [diff] [review] tabmail-close-tab-button.patch Review of attachment 9067478 [details] [diff] [review]: ----------------------------------------------------------------- Hmm, do we ever use the tabs-closebutton button? Is it ever shown?
Reporter | ||
Comment 11•5 years ago
|
||
Thx RIchard! Doesn't seem Firefox has that anymore, and would seem pretty non-useful, so we could remove it. For another bug though.
Comment 12•5 years ago
|
||
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/13000cbf0633
[de-xbl] convert tabmail-close-tab-button. r=mkmelin
Updated•5 years ago
|
Description
•