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

[Close Others] Fix #6019: Contextual Close Others menu entries #6020

Merged

Conversation

marcelgerber
Copy link
Contributor

This is for #6019, it makes the Close Others context menu entries contextual so that they are dynamically disabled and enabled.

CommandManager.get(close_below).setEnabled(true);
}

if (workingSet.length === 1) { // hide "Close Others" when there is only one file in Working Files
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, all the commands should be disabled, since you can't close other files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They will be disabled too as the selected entry is both first and last (and only) entry.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right. Didn't saw that before.

@marcelgerber
Copy link
Contributor Author

Btw: Is there another handler that is called when (before) opening the context menu of the Working Files? currentDocumentChange is called every time you open another doc and maybe it isn't even called when you re-organize your Working Set order or do something similar. So it would be cool if there's another handler.

@ghost ghost assigned JeffryBooher Nov 18, 2013
@njx
Copy link

njx commented Nov 18, 2013

Assigning to @JeffryBooher

@JeffryBooher
Copy link
Contributor

Nominating for Sprint 35

JeffryBooher added a commit that referenced this pull request Feb 28, 2014
[Close Others] Fix #6019: Contextual Close Others menu entries
@JeffryBooher JeffryBooher merged commit aa40f85 into adobe:master Feb 28, 2014
@JeffryBooher
Copy link
Contributor

Looks good...Merging

@marcelgerber marcelgerber deleted the close-others-disabled-entries branch February 28, 2014 19:36
@marcelgerber
Copy link
Contributor Author

I forgot about this PR, but in the meantime I found #5952. I won't say any of these is better or worse, but a difference worth mentioning is using $(workingSetCmenu).on("beforeContextMenuOpen") instead of currentDocumentChange.
I'll just create another PR to get this change in.

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.

4 participants