Class: Pageflow::BackgroundImageHelper::DivWithSizeAttributes

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

Instance Attribute Summary

Attributes inherited from Div

#configuration, #options, #property_base_name

Instance Method Summary collapse

Methods included from RevisionFileHelper

#find_file_in_entry

Methods inherited from Div

#initialize, #render

Constructor Details

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

Instance Method Details

#data_attributesObject



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

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

#inline_styleObject



94
95
96
97
98
99
100
# File 'app/helpers/pageflow/background_image_helper.rb', line 94

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