Projet

Général

Profil

Révision 7547bb19

Ajouté par Assos Assos il y a environ 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/views_slideshow/contrib/views_slideshow_cycle/theme/views_slideshow_cycle.theme.inc
80 80
      drupal_add_js($json_path . '/json2.js');
81 81
    }
82 82

  
83
    // Add hover intent library.
84
    if ($settings['pause']) {
85
      $hoverIntent_path = libraries_get_path('jquery.hoverIntent');
86
      if (!empty($hoverIntent_path) && file_exists($hoverIntent_path . '/jquery.hoverIntent.js')) {
87
        drupal_add_js($hoverIntent_path . '/jquery.hoverIntent.js');
88
      }
89
    }
90

  
91
    // Add jquery easing library.
92
    if (strstr($settings['advanced_options'], '"eas')) {
93
      $easing_path = libraries_get_path('jquery.easing');
94
      if (!empty($easing_path) && file_exists($easing_path . '/jquery.easing.1.3.js')) {
95
        drupal_add_js($easing_path . '/jquery.easing.1.3.js');
96
      }
97
    }
98

  
83 99
    // Load our cycle js.
84 100
    $module_path = drupal_get_path('module', 'views_slideshow_cycle');
85 101
    drupal_add_js($module_path . '/js/views_slideshow_cycle.js');
......
95 111

  
96 112
  drupal_add_js(array('viewsSlideshowCycle' => array('#views_slideshow_cycle_main_' . $vss_id => $settings)), 'setting');
97 113

  
98
  // Add hover intent library.
99
  if ($settings['pause']) {
100
    if (module_exists('libraries')) {
101
      // Load jQuery hoverIntent.
102
      $hoverIntent_path = libraries_get_path('jquery.hoverIntent');
103
      if (!empty($hoverIntent_path) && file_exists($hoverIntent_path . '/jquery.hoverIntent.js')) {
104
        drupal_add_js($hoverIntent_path . '/jquery.hoverIntent.js');
105
      }
106
    }
107
  }
108

  
109 114
  // Add the slideshow elements.
110 115
  $vars['classes_array'][] = 'views_slideshow_cycle_teaser_section';
111 116

  
......
132 137

  
133 138
  $vars['items_per_slide'] = $items_per_slide;
134 139

  
135
  //drupal_set_message(var_export($vars['options']['widgets'],TRUE));
136 140
  $widgets = $vars['options']['widgets'];
137 141
  if (isset($options['top']['views_slideshow_pager']['enabled']) && $options['top']['views_slideshow_pager']['enabled']) {
138 142
    $aria = "aria-labelledby='views_slideshow_pager_field_item_top_${vss_id}_";
......
145 149
  $items = array();
146 150
  $slideshow_count = 0;
147 151
  $rendered_rows = '';
152
  $last_slide = ceil(count($rows) / $items_per_slide);
148 153
  foreach ($rows as $count => $item) {
149 154
    $items[] = $item;
150 155
    if (count($items) == $items_per_slide || $count == (count($rows) - 1)) {
......
154 159
        'count' => $slideshow_count,
155 160
        'view' => $vars['view'],
156 161
        'aria' => $aria . $slideshow_count . "'",
162
        'last_slide' => $last_slide,
157 163
      ));
158 164
      $items = array();
159 165
      $slideshow_count++;
......
175 181

  
176 182
  if ($vars['count']) {
177 183
    $vars['classes_array'][] = 'views_slideshow_cycle_hidden';
184
    if ($current == $vars['last_slide']) {
185
      $vars['classes_array'][] = 'views-row-last';
186
    }
187
  }
188
  else {
189
    $vars['classes_array'][] = 'views-row-first';
178 190
  }
179 191
  $vars['classes_array'][] = ($vars['count'] % 2) ? 'views-row-even' : 'views-row-odd';
180 192

  

Formats disponibles : Unified diff