Class: Pageflow::BackgroundImageHelper::DivWithSizeAttributes

Inherits:
Div
  • Object
show all
Defined in:
app/helpers/pageflow/background_image_helper.rb

Constant Summary

Constants inherited from Div

Pageflow::BackgroundImageHelper::Div::FILE_TYPE_CSS_CLASS_PREFIXES

Instance Attribute Summary

Attributes inherited from Div

#configuration, #options, #property_base_name

Instance Method Summary collapse

Methods inherited from Div

#initialize, #render

Constructor Details

This class inherits a constructor from Pageflow::BackgroundImageHelper::Div

Instance Method Details

#data_attributesObject



80
81
82
83
84
85
86
# File 'app/helpers/pageflow/background_image_helper.rb', line 80

def data_attributes
  if file
    super.merge(:width => file.width, :height => file.height)
  else
    super
  end
end

#inline_styleObject



88
89
90
91
92
93
94
# File 'app/helpers/pageflow/background_image_helper.rb', line 88

def inline_style
  if options[:spanning]
    "padding-top: #{padding_top}%; width: 100%; background-position: 0 0" # fix me (yet disables background_position option)
  else
    super
  end
end