app/models/sir_trevor_rails/blocks/textable.rb in blacklight-spotlight-0.4.1 vs app/models/sir_trevor_rails/blocks/textable.rb in blacklight-spotlight-0.5.0

- old
+ new

@@ -1,26 +1,26 @@ -module SirTrevorRails::Blocks - module Textable +module SirTrevorRails + module Blocks + ## + # Mixin for blocks that display text + module Textable + def text? + text.present? + end - def text? - text.present? - end + def text_align + send(:'text-align') + end - def text_align - send(:'text-align') - end + def content_align + text_align == 'left' ? 'right' : 'left' if text? + end - def content_align - text_align == "left" ? "right" : "left" if text? - end + def text + val = super - def text - val = super - - # empty, in sir-trevor speak - unless val == "<p><br></p>" - val + # empty, in sir-trevor speak + val unless val == '<p><br></p>' end end - end end