Skip to content

Commit

Permalink
Merge pull request #18 from eea/develop
Browse files Browse the repository at this point in the history
Refs #104101 galleryview fixes
  • Loading branch information
alecghica authored Mar 25, 2019
2 parents 79c58f8 + bbec2ee commit 69e1ad8
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 23 deletions.
9 changes: 9 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
=========

11.1 - (2019-03-25)
---------------------
* Bug fix: fixed jquery.galleryview behavior when more than 1 gallery is added
and javascript is loaded on the bottom
[ichim-david refs #104101]
* Change: modified jquery.galleryview to add gallery-panel instead of panel class
thus avoiding clash with other javascripts that are using panel logic
[ichim-david refs #104101]

11.0 - (2019-01-28)
---------------------
* Jenkins: Add sonarqube step
Expand Down
6 changes: 6 additions & 0 deletions eea/jquery/plugins/galleryview/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ GalleryView - jQuery Content Gallery Plugin
Author: Jack Anderson
Documentation: http://www.spaceforaname.com/galleryview/

Version 2.0.2 - 2019-03-22
--------------------------
- removed onLoad buildGallery as moving the js to the bottom can
end up calling the buildGallery more than once
- renamed panel to gallery-panel as panel can interfere with other
javascript

Version 2.0.1 - 2013-05-28
--------------------------
Expand Down
17 changes: 11 additions & 6 deletions eea/jquery/plugins/galleryview/galleryview.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
To create additional rules, use the markup below as a guide to GalleryView's architecture.
<div class="gallery">
<div class="panel">
<div class="gallery-panel">
<img src="path/to/image.jpg" />
<div class="panel-overlay">
...overlay content...
Expand Down Expand Up @@ -40,14 +40,14 @@
.loader { background: url(../../++resource++galleryview/loader.gif) center center no-repeat white; }

/* GALLERY PANELS */
.gallery .panel {
.gallery .gallery-panel {
background: black;
}

/* DEFINE HEIGHT OF PANEL OVERLAY */
/* NOTE - It is best to define padding here as well so overlay and background retain identical dimensions */
.gallery .panel-overlay,
.gallery .panel .overlay-background {
.gallery .gallery-panel .overlay-background {
min-height: 60px;
padding: 1em;
display: block;
Expand All @@ -58,11 +58,11 @@
}

/* PANEL OVERLAY BACKGROUND */
.gallery .panel .overlay-background { background: #222; }
.gallery .gallery-panel .overlay-background { background: #222; }

/* PANEL OVERLAY CONTENT */
.gallery .panel .panel-overlay { color: white; font-size: 13px; }
.gallery .panel .panel-overlay a { color: white; text-decoration: underline; font-weight: bold; }
.gallery .gallery-panel .panel-overlay { color: white; font-size: 13px; }
.gallery .gallery-panel .panel-overlay a { color: white; text-decoration: underline; font-weight: bold; }

/* FILMSTRIP */
/* 'margin' will define top/bottom margin in completed gallery */
Expand All @@ -77,6 +77,11 @@
/* WRAPPER FOR CURRENT FILMSTRIP IMAGE */
.frame.current .img_wrap { border-color: #000; }

/* 104101 thumbnail image is inside the border area when left is 0 */
.img_wrap > img {
left: 0 !important;
}

/* FRAME IMAGES */
.frame img { border: none; }

Expand Down
25 changes: 9 additions & 16 deletions eea/jquery/plugins/galleryview/jquery.galleryview-2.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ var window_loaded = false;
//Transition from current item to item 'i'
function showItem(i) {
//Disable next/prev buttons until transition is complete
var show_filmstrip = j_gallery.find('.strip_wrapper').length;
if(opts.hover_nav_buttons_images) {
$('.nav-next-overlay',j_gallery).unbind('click');
$('.nav-prev-overlay',j_gallery).unbind('click');
Expand All @@ -81,7 +82,7 @@ var window_loaded = false;
j_frames.unbind('click');

//Fade out all frames while fading in target frame
if(opts.show_filmstrip) {
if(show_filmstrip) {
j_frames.removeClass('current').find('img').stop().animate({
'opacity':opts.frame_opacity
},opts.transition_speed);
Expand All @@ -93,7 +94,7 @@ var window_loaded = false;
//If the gallery has panels and the panels should fade, fade out all panels while fading in target panel
if(opts.show_panels && opts.fade_panels) {
j_panels.fadeOut(opts.transition_speed).eq(i%item_count).fadeIn(opts.transition_speed,function(){
if(!opts.show_filmstrip) {
if(!show_filmstrip) {
if(opts.hover_nav_buttons_images) {
$('.nav-prev-overlay',j_gallery).click(showPrevItem);
$('.nav-next-overlay',j_gallery).click(showNextItem);
Expand All @@ -105,7 +106,7 @@ var window_loaded = false;
}

//If gallery has a filmstrip, handle animation of frames
if(opts.show_filmstrip) {
if(show_filmstrip) {
//Slide either pointer or filmstrip, depending on transition method
if(slide_method=='strip') {
//Stop filmstrip if it's currently in motion
Expand Down Expand Up @@ -415,7 +416,7 @@ var window_loaded = false;
$('.overlay-background',j_panels).css('bottom',0);
}

$('.panel iframe',j_panels).css({
$('.gallery-panel iframe',j_panels).css({
'width':opts.panel_width+'px',
'height':opts.panel_height+'px',
'border':'0'
Expand Down Expand Up @@ -800,10 +801,10 @@ var window_loaded = false;
if(opts.show_panels) {
for(i=j_frames.length-1;i>=0;i--) {
if(j_frames.eq(i).find('.panel-content').length>0) {
j_frames.eq(i).find('.panel-content').remove().prependTo(j_gallery).addClass('panel');
j_frames.eq(i).find('.panel-content').remove().prependTo(j_gallery).addClass('gallery-panel');
} else {
p = $('<div>');
p.addClass('panel');
p.addClass('gallery-panel');
im = $('<img />');
im.attr('src',j_frames.eq(i).find('img').eq(0).attr('src')).appendTo(p);
p.prependTo(j_gallery);
Expand All @@ -830,7 +831,7 @@ var window_loaded = false;
j_frame_img_wrappers = $('.img_wrap',j_frames);
}

j_panels = $('.panel',j_gallery);
j_panels = $('.gallery-panel',j_gallery);

if(!opts.show_panels) {
opts.panel_height = 0;
Expand Down Expand Up @@ -924,15 +925,7 @@ var window_loaded = false;
'height':gallery_height+(filmstrip_orientation=='vertical'?(gallery_padding*2):gallery_padding+Math.max(gallery_padding,filmstrip_margin))+'px'
}).appendTo(j_gallery);


if(!window_loaded) {
$(window).load(function(){
window_loaded = true;
buildGallery();
});
} else {
buildGallery();
}
buildGallery();

});
};
Expand Down
2 changes: 1 addition & 1 deletion eea/jquery/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.0
11.1

0 comments on commit 69e1ad8

Please sign in to comment.