Sha256: 56f87b804c8e34f2656209c4c835f14dcfa4d29207b480bc3367236705b7d31b

Contents?: true

Size: 499 Bytes

Versions: 76

Compression:

Stored size: 499 Bytes

Contents

# frozen_string_literal: true

module SirTrevorRails
  module Blocks
    ##
    # Mixin for blocks that display text
    module Textable
      def text?
        text.present?
      end

      def text_align
        send(:'text-align')
      end

      def content_align
        return unless text?

        text_align == 'left' ? 'right' : 'left'
      end

      def text
        val = super

        # empty, in sir-trevor speak
        val unless val == '<p><br></p>'
      end
    end
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
blacklight-spotlight-4.3.6 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-4.3.5 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-4.3.4 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-4.3.3 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-4.3.2 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-4.3.1 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-4.3.0 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-4.2.0 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-4.1.2 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-4.1.1 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-4.1.0 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-4.0.3 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-4.0.2 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-4.0.1 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-4.0.0 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-3.6.0.beta10 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-3.6.0.beta9 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-3.6.0.beta8 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-3.5.0.4 app/models/sir_trevor_rails/blocks/textable.rb
blacklight-spotlight-3.6.0.beta7 app/models/sir_trevor_rails/blocks/textable.rb