Sha256: 6119dfbf6ad5a579db0711bce15db0180b761eee7fd0cfe742ba135cce2ba260

Contents?: true

Size: 369 Bytes

Versions: 7

Compression:

Stored size: 369 Bytes

Contents

module Trestle
  module LayoutHelper
    SIDEBAR_CLASSES = {
      "expanded"  => "sidebar-expanded",
      "collapsed" => "sidebar-collapsed"
    }

    def body_attributes
      {
        class: body_classes
      }.reject { |k, v| v.blank? }
    end

    def body_classes
      [
        SIDEBAR_CLASSES[cookies["trestle:sidebar"]]
      ].compact
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
trestle-0.10.0 app/helpers/trestle/layout_helper.rb
trestle-0.10.0.pre2 app/helpers/trestle/layout_helper.rb
trestle-0.10.0.pre app/helpers/trestle/layout_helper.rb
trestle-0.9.8 app/helpers/trestle/layout_helper.rb
trestle-0.9.7 app/helpers/trestle/layout_helper.rb
trestle-0.9.6 app/helpers/trestle/layout_helper.rb
trestle-0.9.5 app/helpers/trestle/layout_helper.rb