Sha256: 569d1157253c02b210a2b396d682ba53b026f70adf71890d08ce4a9f9b91250f

Contents?: true

Size: 433 Bytes

Versions: 10

Compression:

Stored size: 433 Bytes

Contents

module ExpressTemplates
  module Components
    module Capabilities

      module Hideable

        def self.included(base)
          base.class_eval do

            has_option :hidden, "Toggles visiblity of the component. Assumes hidden CSS class.", type: :boolean, default: false

            before_build -> {
              add_class 'hidden' if config[:hidden]
            }

          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
express_templates-0.11.20 lib/express_templates/components/capabilities/hideable.rb
express_templates-0.11.20.rc1 lib/express_templates/components/capabilities/hideable.rb
express_templates-0.11.19 lib/express_templates/components/capabilities/hideable.rb
express_templates-0.11.18 lib/express_templates/components/capabilities/hideable.rb
express_templates-0.11.17 lib/express_templates/components/capabilities/hideable.rb
express_templates-0.11.16 lib/express_templates/components/capabilities/hideable.rb
express_templates-0.11.16.rc1 lib/express_templates/components/capabilities/hideable.rb
express_templates-0.11.15 lib/express_templates/components/capabilities/hideable.rb
express_templates-0.11.14 lib/express_templates/components/capabilities/hideable.rb
express_templates-0.11.13 lib/express_templates/components/capabilities/hideable.rb