Merge branch 'feature/atomization_ke' into 'develop'
Fixed setWithJSON, allows it to work properly with Atom molecule. See merge request BPHV_MIPS/mvm_core_ui!19
This commit is contained in:
commit
1c33ba0c09
@ -109,23 +109,24 @@ open class CaretButton: MFCustomButton {
|
|||||||
@objc open override func setAsMolecule() {
|
@objc open override func setAsMolecule() {
|
||||||
|
|
||||||
backgroundColor = .clear
|
backgroundColor = .clear
|
||||||
|
setTitleColor(enabledColor, for: .normal)
|
||||||
|
setTitleColor(disabledColor, for: .disabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc override open func setWithJSON(_ json: [AnyHashable: Any]?, delegate: NSObject?, additionalData: [AnyHashable: Any]?) {
|
@objc override open func setWithJSON(_ json: [AnyHashable: Any]?, delegate: NSObject?, additionalData: [AnyHashable: Any]?) {
|
||||||
super.setWithJSON(json, delegate: delegate, additionalData: additionalData)
|
setWithActionMap(json, delegate: delegate as? (MVMCoreActionDelegateProtocol & NSObjectProtocol), additionalData: additionalData)
|
||||||
|
|
||||||
// Configure class properties with JSON values
|
guard let dictionary = json else { return }
|
||||||
guard let jsonDictionary = json else { return }
|
|
||||||
|
|
||||||
if let backgroundColorHex = jsonDictionary[KeyBackgroundColor] as? String {
|
if let backgroundColorHex = dictionary[KeyBackgroundColor] as? String {
|
||||||
backgroundColor = UIColor.mfGet(forHex: backgroundColorHex)
|
backgroundColor = UIColor.mfGet(forHex: backgroundColorHex)
|
||||||
}
|
}
|
||||||
|
|
||||||
if let enableColorHex = jsonDictionary["enableColor"] as? String {
|
if let enabledColorHex = dictionary["enabledColor"] as? String {
|
||||||
enabledColor = UIColor.mfGet(forHex: enableColorHex)
|
enabledColor = UIColor.mfGet(forHex: enabledColorHex)
|
||||||
}
|
}
|
||||||
|
|
||||||
if let disabledColorHex = jsonDictionary["disabledColor"] as? String {
|
if let disabledColorHex = dictionary["disabledColor"] as? String {
|
||||||
disabledColor = UIColor.mfGet(forHex: disabledColorHex)
|
disabledColor = UIColor.mfGet(forHex: disabledColorHex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user