Sha256: 0e6f56b6e2227b6bb472ae3e69f5c3625689a9ebb06a39bd7c085c948b57dfd4

Contents?: true

Size: 616 Bytes

Versions: 25

Compression:

Stored size: 616 Bytes

Contents

module Locomotive::Steam

  class EditableElement

    include Locomotive::Steam::Models::Entity

    attr_accessor :page

    def initialize(attributes = {})
      super({
        label:          nil,
        block:          nil,
        content:        nil,
        source:         nil,
        inline_editing: true
      }.merge(attributes))
    end

    def source
      self[:source].blank? ? self.content : self[:source]
    end

    def content
      self[:source].blank? ? self[:content] : self[:source]
    end

    def format
      self[:format] || 'html' # only editable_text elements
    end

  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
locomotivecms_steam-1.8.0.alpha2 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.8.0.alpha1 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.7.1 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.7.0 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.6.1 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.6.0 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.6.0.rc1 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.6.0.beta1 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.5.3 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.5.2 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.5.1 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.5.0 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.5.0.rc1 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.5.0.rc0 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.5.0.beta3 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.5.0.beta2 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.5.0.beta1 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.4.1 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.4.0 lib/locomotive/steam/entities/editable_element.rb
locomotivecms_steam-1.4.0.rc2 lib/locomotive/steam/entities/editable_element.rb