mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Minor performance improvement to CPContinuouslyUpdatesValueBindingOption.
This commit is contained in:
@@ -149,6 +149,18 @@ var CPControlBlackColor = [CPColor blackColor];
|
||||
return [super _binderClassForBinding:theBinding];
|
||||
}
|
||||
|
||||
/*!
|
||||
Reverse set the binding iff the CPContinuouslyUpdatesValueBindingOption is set.
|
||||
*/
|
||||
- (void)_continuouslyReverseSetBinding
|
||||
{
|
||||
var binderClass = [[self class] _binderClassForBinding:CPValueBinding],
|
||||
theBinding = [binderClass getBinding:CPValueBinding forObject:self];
|
||||
|
||||
if ([theBinding continuouslyUpdatesValue])
|
||||
[theBinding reverseSetValueFor:@"objectValue"];
|
||||
}
|
||||
|
||||
- (void)_reverseSetBinding
|
||||
{
|
||||
var binderClass = [[self class] _binderClassForBinding:CPValueBinding],
|
||||
|
||||
@@ -808,11 +808,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
if ([note object] !== self)
|
||||
return;
|
||||
|
||||
var binderClass = [[self class] _binderClassForBinding:CPValueBinding],
|
||||
theBinding = [binderClass getBinding:CPValueBinding forObject:self];
|
||||
|
||||
if ([theBinding continuouslyUpdatesValue])
|
||||
[self _reverseSetBinding];
|
||||
[self _continuouslyReverseSetBinding];
|
||||
|
||||
[super textDidChange:note];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user