Sha256: 24d1110d2f21963a364fde8fd6081a51963ae6904e3b3bd026c33a263e1e93db
Contents?: true
Size: 975 Bytes
Versions: 7
Compression:
Stored size: 975 Bytes
Contents
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 end def input_class custom? ? ["custom-control-input"] : ["form-check-input"] end def label_class custom? ? ["custom-control-label"] : ["form-check-label"] end def defaults Trestle::Options.new(disabled: readonly?) end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems