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

Improvements to middle-click closing files #4576

Merged
merged 1 commit into from
Jul 31, 2013
Merged

Conversation

peterflynn
Copy link
Member

Improved fix for #3889 (Middle click should close files)

  • Don't go through normal selection-click handling codepath first: detect middle click in the same place we filter out close-button clicks. This means the file is closed instantly, as opposed to a delay while it's loaded / switched to first. No longer need a separate middle-click listener as a result.
  • Use constants for event.which
  • Remove long-commented-out rename code
  • Move misplaced comment ("might never have been opened") to its rightful home

@RaymondLim I think this conflicts a little bit with your advice in the original PR #3901, so maybe you could take a look?

- Don't go through normal selection-click handling codepath first: detect
middle click in the same place we filter out close-button clicks. No longer
need a separate click listener as a result.
- Use constants for event.which
- Remove long-commented-out rename code
- Move misplaced comment ("might never have been opened") to its rightful
home
@ghost ghost assigned RaymondLim Jul 29, 2013
@@ -42,6 +42,10 @@ define(function (require, exports, module) {
ViewUtils = require("utils/ViewUtils");


/** @const @type {number} Constants for event.which values */
var LEFT_BUTTON = 1,
MIDDLE_BUTTON = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice to see those defined as constant. Don't we also need to define RIGHT_BUTTON?

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't bother to define right button. We're not using it anywhere any way. We can always add it here when we need it.

@RaymondLim
Copy link
Contributor

Looks good. Merging.

RaymondLim added a commit that referenced this pull request Jul 31, 2013
Improvements to middle-click closing files
@RaymondLim RaymondLim merged commit a08eb28 into master Jul 31, 2013
@RaymondLim RaymondLim deleted the pflynn/middle-close branch July 31, 2013 23:51
@peterflynn
Copy link
Member Author

Thanks for the review @RaymondLim!

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.

2 participants