-
Notifications
You must be signed in to change notification settings - Fork 280
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
Move 'tab-clicked' message response handling next to 'tab-mouseup' #2306
Conversation
Thanks! Hmm, but you looks don't need to import a background module And one more concern: is this compatible to Multiple Tab Handler and other API clients? |
Additional changes per request: Moved As for MTH there doesn't seems to be any incompatibility. The API should work just like before except that, if any one of |
@@ -26,15 +26,10 @@ import * as Background from './background.js'; | |||
import * as TabsGroup from './tabs-group.js'; | |||
import * as Tree from './tree.js'; | |||
import * as Commands from './commands.js'; | |||
import * as HandleTabMultiselect from './handle-tab-multiselect.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module still need to be loaded from anywhere on the background page (for example background/index.js or background/background.js) to multiselect collapsed tree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry wasn't really understanding how javascript import works. In any case you appear to have already been loading this module in background/index.js
. I just tested that multiselect collapsed tree (where collapsed tabs are automatically selected as well) still works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you right. I missed that it was already loaded from index.js.
|
||
(async () => { | ||
log('Constants.kNOTIFY_TAB_MOUSEDOWN'); | ||
await Tab.waitUntilTracked(mousedownDetail.tab); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check (L270-L273) looks needless anymore. Originally this was introduced for safety about cross-namespace asynchronous operation, and now the tab
(got with const tab = EventUtils.getTabFromEvent(event) || EventUtils.getTabFromTabbarEvent(event);
) looks certainly available.
Anyway, almost looks good to merge. Thanks a lot! |
After merging I've done some more changes. If my changes break functionalities, please comment here. |
Match behavior described here:
https://github.com/piroor/treestyletab/wiki/API-for-other-addons#when-a-tab-is-clicked
Alternatively there's this workaround for tst-tabflip. Whichever gets merged first...