mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
fixed: redraw issues
This commit is contained in:
@@ -207,8 +207,28 @@ var CPRuleEditorItemPBoardType = @"CPRuleEditorItemPBoardType",
|
||||
|
||||
[self registerForDraggedTypes:[CPArray arrayWithObjects:CPRuleEditorItemPBoardType,nil]];
|
||||
[_boundArrayOwner addObserver:self forKeyPath:_boundArrayKeyPath options:CPKeyValueObservingOptionOld | CPKeyValueObservingOptionNew context:boundArrayContext];
|
||||
|
||||
[[CPNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(_ruleEditorLocalizerDidLoad:)
|
||||
name:@"_CPRuleEditorLocalizerDidLoadNotification"
|
||||
object:nil];
|
||||
}
|
||||
|
||||
- (void)_ruleEditorLocalizerDidLoad:(CPNotification)aNotification
|
||||
{
|
||||
if ([aNotification object] === [self standardLocalizer])
|
||||
{
|
||||
// Defer execution to the next run loop cycle so that any active slice
|
||||
// insertions have fully completed and are present in the `_slices` array.
|
||||
[[CPRunLoop mainRunLoop] performBlock:function() {
|
||||
var count = [_slices count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
[[_slices objectAtIndex:i] _reconfigureSubviews];
|
||||
}
|
||||
} argument:nil order:0 modes:[CPDefaultRunLoopMode]];
|
||||
}
|
||||
}
|
||||
/*! @endcond */
|
||||
|
||||
/*!
|
||||
|
||||
@@ -77,6 +77,9 @@ var LocalizerStringsRegex = new RegExp("\"(.+)\"\\s*=\\s*\"(.+)\"\\s*;\\s*(//.+)
|
||||
}
|
||||
|
||||
_dictionary = [CPDictionary dictionaryWithDictionary:dict];
|
||||
|
||||
// Post notification to let the rule editor know the translation dictionary is ready
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:@"_CPRuleEditorLocalizerDidLoadNotification" object:self];
|
||||
}
|
||||
|
||||
- (CPString)localizedStringForString:(CPString)aString
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
|
||||
if ([criterion isEqualToString:@"firstName"] || [criterion isEqualToString:@"lastName"])
|
||||
{
|
||||
return [@[@"contains", @"is equal to"] objectAtIndex:index];
|
||||
// "is equal to" is placed at index 0 so that the reordered Spanish sentence layout loads automatically on startup
|
||||
return [@[@"is equal to", @"contains"] objectAtIndex:index];
|
||||
}
|
||||
|
||||
if ([criterion isEqualToString:@"age"])
|
||||
@@ -54,7 +55,7 @@
|
||||
|
||||
if ([criterion isEqualToString:@"contains"] || [criterion isEqualToString:@"is equal to"])
|
||||
{
|
||||
// Operators have one child representing the input field value
|
||||
// Operators have 1 child representing the value node
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -104,7 +105,30 @@
|
||||
}
|
||||
else if ([criterion isEqualToString:@"value"])
|
||||
{
|
||||
[parts setObject:[CPExpression expressionForConstantValue:[value stringValue]] forKey:CPRuleEditorPredicateRightExpression];
|
||||
// Resolve the correct active text field from the slice row on screen
|
||||
var activeValue = value;
|
||||
var slices = [editor valueForKey:@"_slices"];
|
||||
|
||||
if (slices && row < [slices count])
|
||||
{
|
||||
var slice = [slices objectAtIndex:row];
|
||||
var optionViews = [slice valueForKey:@"_ruleOptionViews"];
|
||||
if (optionViews)
|
||||
{
|
||||
var count = [optionViews count];
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var view = [optionViews objectAtIndex:i];
|
||||
if ([view isKindOfClass:[CPTextField class]] && [view isEditable])
|
||||
{
|
||||
activeValue = view;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[parts setObject:[CPExpression expressionForConstantValue:[activeValue stringValue]] forKey:CPRuleEditorPredicateRightExpression];
|
||||
}
|
||||
|
||||
return parts;
|
||||
|
||||
Reference in New Issue
Block a user