Fix some issues in Expose view:

-Fix an error complaing of nm existance(eg.link widget)
-Some styling to thumbnail indicator
-Add hideControlsOnSlideshow to the blueimp gallery plugin to be able to hide the controls
This commit is contained in:
Hadi Nategh 2015-01-21 11:10:17 +00:00
parent a6bb0589e3
commit 33cf3205fa
3 changed files with 33 additions and 4 deletions

View File

@ -67,7 +67,7 @@ function expose (widget)
while(nextmatch == null && current) while(nextmatch == null && current)
{ {
current = current.getParent(); current = current.getParent();
if(current.instanceOf(et2_nextmatch)) if(typeof current !='undefined' && current.instanceOf(et2_nextmatch))
{ {
nextmatch = current; nextmatch = current;
} }
@ -104,7 +104,7 @@ function expose (widget)
if(data && data.data && data.data.mime && mime_regex.test(data.data.mime)) if(data && data.data && data.data.mime && mime_regex.test(data.data.mime))
{ {
var media = this.getMedia(data.data); var media = this.getMedia(data.data);
images[i] = (jQuery.extend({}, data.data, media[0])); images.push(jQuery.extend({}, data.data, media[0]));
} }
} }
@ -214,6 +214,8 @@ function expose (widget)
preloadRange: 2, preloadRange: 2,
// The transition speed between slide changes in milliseconds: // The transition speed between slide changes in milliseconds:
transitionSpeed: 400, transitionSpeed: 400,
//Hide controls when the slideshow is playing
hideControlsOnSlideshow: true,
// The transition speed for automatic slide changes, set to an integer // The transition speed for automatic slide changes, set to an integer
// greater 0 to override the default transition speed: // greater 0 to override the default transition speed:
slideshowTransitionSpeed: undefined, slideshowTransitionSpeed: undefined,
@ -288,7 +290,7 @@ function expose (widget)
var self=this; var self=this;
// If the media type is not supported do not bind the click handler // If the media type is not supported do not bind the click handler
if (_value && typeof _value.mime != 'undefined' && !_value.mime.match(/^(video|image|audio|media)\//,'ig')) if (_value && typeof _value.mime != 'undefined' && !_value.mime.match(mime_regex,'ig'))
{ {
return; return;
} }

View File

@ -1755,8 +1755,33 @@ span.et2_egw_action_ddHelper_itemsCnt {
*/ */
/* Paginating with nextmatch */ /* Paginating with nextmatch */
.blueimp-gallery-controls > .indicator.paginating { .blueimp-gallery-controls > .indicator.paginating {
max-height: 2em; border-bottom: 2px solid rgba(255, 255, 255, 0.5);
border-top: 2px solid rgba(255, 255, 255, 0.5);
left: 0px; left: 0px;
right: auto; right: auto;
white-space: nowrap; white-space: nowrap;
}
/*Carousel thumbnails*/
.blueimp-gallery>.indicator>li {
display: inline-block;
width: 46px;
height: 46px;
margin: none;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
border: 1px solid transparent;
background: #ccc;
background: rgba(255, 255, 255, 0.17)center no-repeat;
border-radius: 5px;
box-shadow: 0 0 2px #000;
opacity: .5;
cursor: pointer;
background-repeat: no-repeat;
margin: 2px;
}
/*Slideshow Play/Pause button*/
.blueimp-gallery>.play-pause{
right: 42px;
top: 23px;
} }

View File

@ -49,6 +49,7 @@ function(a) {
unloadElements: !0, unloadElements: !0,
startSlideshow: !1, startSlideshow: !1,
slideshowInterval: 5e3, slideshowInterval: 5e3,
hideControlsOnSlideshow:false,
index: 0, index: 0,
preloadRange: 2, preloadRange: 2,
transitionSpeed: 400, transitionSpeed: 400,
@ -144,6 +145,7 @@ function(a) {
}, },
play: function(a) { play: function(a) {
var b = this; var b = this;
if (this.options.hideControlsOnSlideshow) this.container.removeClass(this.options.controlsClass);
window.clearTimeout(this.timeout), this.interval = a || this.options.slideshowInterval, this.elements[this.index] > 1 && (this.timeout = this.setTimeout(!this.requestAnimationFrame && this.slide || window.clearTimeout(this.timeout), this.interval = a || this.options.slideshowInterval, this.elements[this.index] > 1 && (this.timeout = this.setTimeout(!this.requestAnimationFrame && this.slide ||
function(a, c) { function(a, c) {
b.animationFrameId = b.requestAnimationFrame.call(window, function() { b.animationFrameId = b.requestAnimationFrame.call(window, function() {