Skip to content

Commit

Permalink
Fixes appearance of placeholder when emptying Description field befor…
Browse files Browse the repository at this point in the history
…e upload
  • Loading branch information
EddyLB committed Jan 3, 2020
1 parent 535c7b4 commit 3b7e5f5
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions piwigo/Upload/Upload Parameters/ImageUploadParamsViewController.m
Expand Up @@ -586,21 +586,11 @@ -(void)textFieldDidEndEditing:(UITextField *)textField
-(void)textViewDidBeginEditing:(UITextView *)textView
{
self.shouldUpdateComment = YES;
if ([textView.text isEqualToString:NSLocalizedString(@"editImageDetails_descriptionPlaceholder", @"Description")]) {
textView.text = @"";
textView.textColor = [UIColor piwigoLeftLabelColor];
}
}

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
NSString *finalString = [textView.text stringByReplacingCharactersInRange:range withString:text];
if ([finalString isEqualToString:@""]) {
textView.text = NSLocalizedString(@"editImageDetails_descriptionPlaceholder", @"Description");
textView.textColor = [UIColor piwigoRightLabelColor];
}

// Store actual description if cell exists
self.commonParameters.comment = finalString;
return YES;
}
Expand All @@ -613,12 +603,6 @@ -(BOOL)textViewShouldEndEditing:(UITextView *)textView

-(void)textViewDidEndEditing:(UITextView *)textView
{
if ([textView.text isEqualToString:@""]) {
textView.text = NSLocalizedString(@"editImageDetails_descriptionPlaceholder", @"Description");
textView.textColor = [UIColor piwigoRightLabelColor];
}

// Store actual description if cell exists
self.commonParameters.comment = textView.text;
}

Expand Down

0 comments on commit 3b7e5f5

Please sign in to comment.