udpated to fix bug in resetting
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
7819cd8646
commit
3db7cf0a42
@ -41,7 +41,7 @@ extension TitleLockup {
|
|||||||
subTitleModel = TitleLockupSubTitleModel(text: model.text, textColor: model.textColor, textAttributes: model.textAttributes)
|
subTitleModel = TitleLockupSubTitleModel(text: model.text, textColor: model.textColor, textAttributes: model.textAttributes)
|
||||||
otherTypograpicalStyle = model.typographicalStyle.value
|
otherTypograpicalStyle = model.typographicalStyle.value
|
||||||
} else {
|
} else {
|
||||||
reset()
|
subTitleModel = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ extension TitleLockup {
|
|||||||
if let model, !model.text.isEmpty {
|
if let model, !model.text.isEmpty {
|
||||||
titleModel = TitleLockupTitleModel(text: model.text, textAttributes: model.textAttributes, typographicalStyle: model.typographicalStyle.value)
|
titleModel = TitleLockupTitleModel(text: model.text, textAttributes: model.textAttributes, typographicalStyle: model.typographicalStyle.value)
|
||||||
} else {
|
} else {
|
||||||
reset()
|
titleModel = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -254,8 +254,10 @@ open class TitleLockup: View {
|
|||||||
eyebrowLabel.attributes = eyebrowModel.textAttributes
|
eyebrowLabel.attributes = eyebrowModel.textAttributes
|
||||||
eyebrowLabel.numberOfLines = eyebrowModel.numberOfLines
|
eyebrowLabel.numberOfLines = eyebrowModel.numberOfLines
|
||||||
eyebrowLabel.surface = surface
|
eyebrowLabel.surface = surface
|
||||||
|
} else {
|
||||||
|
eyebrowLabel.reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
if let titleModel, !titleModel.text.isEmpty {
|
if let titleModel, !titleModel.text.isEmpty {
|
||||||
titleTextIsEmpty = false
|
titleTextIsEmpty = false
|
||||||
titleLabel.textPosition = allLabelsTextPosition
|
titleLabel.textPosition = allLabelsTextPosition
|
||||||
@ -264,6 +266,8 @@ open class TitleLockup: View {
|
|||||||
titleLabel.attributes = titleModel.textAttributes
|
titleLabel.attributes = titleModel.textAttributes
|
||||||
titleLabel.numberOfLines = titleModel.numberOfLines
|
titleLabel.numberOfLines = titleModel.numberOfLines
|
||||||
titleLabel.surface = surface
|
titleLabel.surface = surface
|
||||||
|
} else {
|
||||||
|
titleLabel.reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
if let subTitleModel, !subTitleModel.text.isEmpty {
|
if let subTitleModel, !subTitleModel.text.isEmpty {
|
||||||
@ -275,6 +279,8 @@ open class TitleLockup: View {
|
|||||||
subTitleLabel.numberOfLines = subTitleModel.numberOfLines
|
subTitleLabel.numberOfLines = subTitleModel.numberOfLines
|
||||||
subTitleLabel.surface = surface
|
subTitleLabel.surface = surface
|
||||||
subTitleLabel.disabled = subTitleModel.textColor == .secondary
|
subTitleLabel.disabled = subTitleModel.textColor == .secondary
|
||||||
|
} else {
|
||||||
|
subTitleLabel.reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
//if both first 2 rows not empty set spacing
|
//if both first 2 rows not empty set spacing
|
||||||
@ -291,6 +297,11 @@ open class TitleLockup: View {
|
|||||||
} else if (!eyebrowTextIsEmpty || !titleTextIsEmpty) && subTitleTextIsEmpty {
|
} else if (!eyebrowTextIsEmpty || !titleTextIsEmpty) && subTitleTextIsEmpty {
|
||||||
stackView.setCustomSpacing(0.0, after: titleLabel)
|
stackView.setCustomSpacing(0.0, after: titleLabel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//hide/show
|
||||||
|
eyebrowLabel.isHidden = eyebrowTextIsEmpty
|
||||||
|
titleLabel.isHidden = titleTextIsEmpty
|
||||||
|
subTitleLabel.isHidden = subTitleTextIsEmpty
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user