Skip to content

Commit

Permalink
Merge pull request ResearchKit#1170 from srinathtm-apple/FixForIssue1168
Browse files Browse the repository at this point in the history
adding new css style class to handle signature image
  • Loading branch information
srinathtm-apple authored Sep 4, 2018
2 parents 0598cbd + 543fb89 commit 8a44bce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ResearchKit/Consent/ORKConsentDocument.m
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ + (NSString *)cssStyleSheet:(BOOL)mobile {
}

[css appendFormat:@".col-1-3 { width: %@; float: left; padding-right: 20px; margin-top: 100px;}\n", mobile ? @"66.6%" : @"33.3%"];
[css appendString:@".sigbox { position: relative; height: 300px; max-height:100px; display: inline-block; bottom: 10px }\n"];
[css appendString:@".inbox { position: absolute; bottom: 0; left:0; top: 100%%; transform: translateY(-100%%); -webkit-transform: translateY(-100%%); }\n"];
[css appendString:@".sigbox { position: relative; height: 100px; max-height:100px; display: inline-block; bottom: 10px }\n"];
[css appendString:@".inbox { position: absolute; bottom:10px; top: 100%%; transform: translateY(-100%%); -webkit-transform: translateY(-100%%); }\n"];
[css appendString:@".inboxImage { position: relative; bottom:60px; top: 100%%; transform: translateY(-100%%); -webkit-transform: translateY(-100%%); }\n"];
[css appendString:@".grid:after { content: \"\"; display: table; clear: both; }\n"];
[css appendString:@".border { -webkit-box-sizing: border-box; box-sizing: border-box; }\n"];

Expand Down
3 changes: 2 additions & 1 deletion ResearchKit/Consent/ORKConsentSignatureFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ - (NSString *)HTMLForSignature:(ORKConsentSignature *)signature {
NSString *hr = @"<hr align='left' width='100%' style='height:1px; border:none; color:#000; background-color:#000; margin-top: -10px; margin-bottom: 0px;' />";

NSString *signatureElementWrapper = @"<p><br/><div class='sigbox'><div class='inbox'>%@</div></div>%@%@</p>";
NSString *signatureImageWrapper = @"<p><br/><div class='sigbox'><div class='inboxImage'>%@</div></div>%@%@</p>";

BOOL addedSig = NO;

Expand Down Expand Up @@ -87,7 +88,7 @@ - (NSString *)HTMLForSignature:(ORKConsentSignature *)signature {
[body appendString:@"<br/>"];
}
NSString *titleFormat = ORKLocalizedString(@"CONSENT_DOC_LINE_SIGNATURE", nil);
[signatureElements addObject:[NSString stringWithFormat:signatureElementWrapper, imageTag ? : @"&nbsp;", hr, [NSString stringWithFormat:titleFormat, signature.title]]];
[signatureElements addObject:[NSString stringWithFormat:signatureImageWrapper, imageTag ? : @"&nbsp;", hr, [NSString stringWithFormat:titleFormat, signature.title]]];
}

if (addedSig) {
Expand Down

0 comments on commit 8a44bce

Please sign in to comment.