You are here

protected function isotope_reaction::get_css_settings in Isotope (with Masonry and Packery) 7

Return CSS settings for isotope items based on configured layoutMode.

Parameters

(array) $reaction: A reaction array from the execute function

Return value

(array) A an array of jQuery css parameters.

1 call to isotope_reaction::get_css_settings()
isotope_reaction::execute in plugins/isotope_reaction.inc
Display a message to the user.

File

plugins/isotope_reaction.inc, line 170
Contains the isotope_reaction subclass.

Class

isotope_reaction
Expose isotope configurations as context reactions.

Code

protected function get_css_settings($reaction) {

  // The list of css settings and the deplay modes that utilize them.
  $options = array(
    'width' => array(
      'cellsByColumn',
      'cellsByRow',
      'masonry',
    ),
    'height' => array(
      'cellsByColumn',
      'cellsByRow',
      'masonryHorizontal',
    ),
  );

  // Set the css settings based on the configured options.
  foreach ($options as $setting => $modes) {
    if (in_array($reaction['layout_mode'], $modes)) {
      $css[$setting] = TRUE;
    }
  }
  return isset($css) ? $css : FALSE;
}