Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
field_slideshow
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
field_slideshow
Commits
81c4bdeb
Commit
81c4bdeb
authored
14 years ago
by
Jérôme Danthinne
Browse files
Options
Downloads
Patches
Plain Diff
[
#1053688
] fixed : added some padding to the slideshow in order to display the caption
parent
d23bba34
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
field_slideshow.module
+9
-3
9 additions, 3 deletions
field_slideshow.module
with
9 additions
and
3 deletions
field_slideshow.module
+
9
−
3
View file @
81c4bdeb
...
...
@@ -346,8 +346,8 @@ function theme_field_slideshow($variables) {
static
$field_slideshow_id
=
-
1
;
$field_slideshow_id
++
;
$classes
=
array
(
'field-slideshow'
,
'field-slideshow-'
.
$field_slideshow_id
,
'effect-'
.
$variables
[
'fx'
],
'timeout-'
.
$variables
[
'timeout'
]);
if
(
$variables
[
'caption'
])
$classes
[]
=
'caption-'
.
$variables
[
'caption'
];
if
(
$variables
[
'pager'
])
$classes
[]
=
'with-pager'
;
if
(
$variables
[
'caption'
]
!=
''
)
$classes
[]
=
'caption-'
.
$variables
[
'caption'
];
if
(
$variables
[
'pager'
]
!=
''
)
$classes
[]
=
'with-pager'
;
if
(
$variables
[
'controls'
])
$classes
[]
=
'with-controls'
;
$output
=
'<div id="field-slideshow-'
.
$field_slideshow_id
.
'-wrapper" class="field-slideshow-wrapper">
<div class="'
.
implode
(
' '
,
$classes
)
.
'" style="width:'
.
$slides_max_width
.
'px; height:'
.
$slides_max_height
.
'px">'
;
...
...
@@ -357,17 +357,23 @@ function theme_field_slideshow($variables) {
// Add the Cycle plugin
drupal_add_js
(
drupal_get_path
(
'module'
,
'field_slideshow'
)
.
'/js/jquery.cycle.all.min.js'
);
//
Generate
javascript
//
Begin
javascript
generation
$js
=
'jQuery(window).load(function () {
jQuery(".field-slideshow-'
.
$field_slideshow_id
.
'")'
;
// Add Caption height if exists
if
(
$variables
[
'caption'
]
!=
''
)
$js
.
=
'.css("padding-bottom", (jQuery(".field-slideshow-'
.
$field_slideshow_id
.
' .field-slideshow-caption").outerHeight() + parseInt(jQuery(".field-slideshow-'
.
$field_slideshow_id
.
' .field-slideshow-slide img").css("margin-bottom"))) + "px")'
;
// Create Pager wrapper
if
(
$variables
[
'pager'
]
!=
''
)
{
$js
.
=
'.after("<'
.
(
$variables
[
'pager'
]
==
'image'
?
'ul'
:
'div'
)
.
' id=\'field-slideshow-'
.
$field_slideshow_id
.
'-pager\' class=\'field-slideshow-pager\'/>")'
;
}
// Create Controls
if
(
$variables
[
'controls'
])
{
$js
.
=
'.after("<div id=\'field-slideshow-'
.
$field_slideshow_id
.
'-controls\' class=\'field-slideshow-controls\'><a href=\'#\' class=\'prev\'>'
.
t
(
'Prev'
)
.
'</a><a href=\'#\' class=\'next\'>'
.
t
(
'Next'
)
.
'</a></div>")'
;
}
// Add options
$js
.
=
'.cycle({
resizing : 0,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment