mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-06 17:12:50 +00:00
Fix: don't touch the item state unless disabling
This commit is contained in:
1 parent
ae2ed8bf94
commit
226bf5299e
1 file changed
+3
-5
@@ -629,8 +629,7 @@ var _CPMenuBarVisible = NO,
|
||||
if (!validator)
|
||||
{
|
||||
// Check to see if there is a target binding with a valid selector
|
||||
var info = [CPBinder infoForBinding:CPTargetBinding forObject:item],
|
||||
valid = NO;
|
||||
var info = [CPBinder infoForBinding:CPTargetBinding forObject:item];
|
||||
|
||||
if (info)
|
||||
{
|
||||
@@ -640,10 +639,9 @@ var _CPMenuBarVisible = NO,
|
||||
target = [object valueForKeyPath:keyPath],
|
||||
selector = [options valueForKey:CPSelectorNameBindingOption];
|
||||
|
||||
valid = target && selector && [target respondsToSelector:CPSelectorFromString(selector)];
|
||||
if (target && selector && ![target respondsToSelector:CPSelectorFromString(selector)])
|
||||
[item setEnabled:NO];
|
||||
}
|
||||
|
||||
[item setEnabled:valid];
|
||||
}
|
||||
else if (![validator respondsToSelector:[item action]])
|
||||
[item setEnabled:NO];
|
||||
|
||||
Reference in new issue
Block a user