mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Fix a bug in wrong code order in _CPMenuManager.j making usage of undeclared variable. Also add some missing imports
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
@import <Foundation/CPObject.j>
|
||||
@import <Foundation/Foundation.j>
|
||||
@import "CPWindow.j"
|
||||
@import "CPEvent.j"
|
||||
|
||||
@class _CPMenuWindow
|
||||
|
||||
|
||||
@global CPApp
|
||||
@global CPMenuDidEndTrackingNotification
|
||||
@global _CPMenuWindowMenuBarBackgroundStyle
|
||||
@@ -133,15 +136,6 @@ var STICKY_TIME_INTERVAL = 0.5,
|
||||
return;
|
||||
}
|
||||
|
||||
if (_keyBuffer)
|
||||
{
|
||||
if (([anEvent timestamp] - _startTime) > (STICKY_TIME_INTERVAL + [activeMenu numberOfItems] / 2))
|
||||
[self selectNextItemBeginningWith:_keyBuffer inMenu:menu clearBuffer:YES];
|
||||
|
||||
if (type === CPPeriodic)
|
||||
return;
|
||||
}
|
||||
|
||||
// Periodic events don't have a valid location.
|
||||
var globalLocation = type === CPPeriodic ? _lastGlobalLocation : [anEvent globalLocation];
|
||||
|
||||
@@ -157,6 +151,15 @@ var STICKY_TIME_INTERVAL = 0.5,
|
||||
activeItemIndex = activeMenuContainer ? [activeMenuContainer itemIndexAtPoint:menuLocation] : CPNotFound,
|
||||
activeItem = activeItemIndex !== CPNotFound ? [activeMenu itemAtIndex:activeItemIndex] : nil;
|
||||
|
||||
if (_keyBuffer)
|
||||
{
|
||||
if (([anEvent timestamp] - _startTime) > (STICKY_TIME_INTERVAL + [activeMenu numberOfItems] / 2))
|
||||
[self selectNextItemBeginningWith:_keyBuffer inMenu:menu clearBuffer:YES];
|
||||
|
||||
if (type === CPPeriodic)
|
||||
return;
|
||||
}
|
||||
|
||||
// unhighlight when mouse is moved off the menu
|
||||
if (_lastGlobalLocation && CGRectContainsPoint([activeMenuContainer globalFrame], _lastGlobalLocation)
|
||||
&& !CGRectContainsPoint([activeMenuContainer globalFrame], globalLocation))
|
||||
|
||||
Reference in New Issue
Block a user