Script origins control inline policy, all scripts allowed for tab
This commit is contained in:
@@ -15,10 +15,7 @@ class ScriptPolicyControl: UIControl
|
||||
}
|
||||
|
||||
var policyStatus: PolicyStatus = .blocked {
|
||||
didSet {
|
||||
sendActions(for: .valueChanged)
|
||||
setNeedsLayout()
|
||||
}
|
||||
didSet { setNeedsLayout() }
|
||||
}
|
||||
|
||||
private class PolicyButton: UIButton {
|
||||
@@ -35,12 +32,14 @@ class ScriptPolicyControl: UIControl
|
||||
|
||||
allowButton.addAction(UIAction(handler: { _ in
|
||||
self.policyStatus = .allowed
|
||||
self.sendActions(for: .valueChanged)
|
||||
}), for: .touchUpInside)
|
||||
allowButton.imageView?.contentMode = .scaleAspectFit
|
||||
addSubview(allowButton)
|
||||
|
||||
denyButton.addAction(UIAction(handler: { _ in
|
||||
self.policyStatus = .blocked
|
||||
self.sendActions(for: .valueChanged)
|
||||
}), for: .touchUpInside)
|
||||
denyButton.imageView?.contentMode = .scaleAspectFit
|
||||
addSubview(denyButton)
|
||||
|
||||
Reference in New Issue
Block a user