lib/trestle/form/fields/check_box_helpers.rb in trestle-0.9.8 vs lib/trestle/form/fields/check_box_helpers.rb in trestle-0.10.0.pre
- old
+ new
@@ -1,41 +1,30 @@
module Trestle
class Form
module Fields
module CheckBoxHelpers
- def custom?
- options[:custom] != false
- end
-
def switch?
options[:switch]
end
def inline?
options[:inline]
end
def default_wrapper_class
- if custom?
- [
- "custom-control",
- switch? ? "custom-switch" : "custom-checkbox",
- ("custom-control-inline" if inline?)
- ].compact
- else
- [
- "form-check",
- ("form-check-inline" if inline?)
- ].compact
- end
+ [
+ "form-check",
+ ("form-switch" if switch?),
+ ("form-check-inline" if inline?)
+ ].compact
end
def input_class
- custom? ? ["custom-control-input"] : ["form-check-input"]
+ ["form-check-input"]
end
def label_class
- custom? ? ["custom-control-label"] : ["form-check-label"]
+ ["form-check-label"]
end
def defaults
Trestle::Options.new(disabled: readonly?)
end