Sha256: afaffaa9bfa5cc76c0b244a4d4bdf11980513279cea3d434458859c47471f719

Contents?: true

Size: 688 Bytes

Versions: 3

Compression:

Stored size: 688 Bytes

Contents

class TabbedContentTabWidget < Widget
  attribute :title, :string, default: 'New Tab'
  attribute :content, :widgetlist

  attribute :background_color, :string

  def self.valid_container_classes
    [TabbedContentWidget]
  end

  def self.description_for_editor
    'Tab'
  end

  def classes(index)
    css = ["scrivito-tab-title"]
    css << "scrivito-tab-active" if index == 0
    css << self.background_color
    css.join(" ")
  end

  def scrivito_selectable_color_classes
    helper = ApplicationController.helpers
    if helper.respond_to? 'scrivito_selectable_color_classes'
      helper.scrivito_selectable_color_classes('accordion_widget', 'background_color')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
scrivito_tabbed_content_widget-0.90.3 app/models/tabbed_content_tab_widget.rb
scrivito_tabbed_content_widget-0.90.2 app/models/tabbed_content_tab_widget.rb
scrivito_tabbed_content_widget-0.90.1 app/models/tabbed_content_tab_widget.rb