Browse files

added disable play button option for galleries with one photo

  • Loading branch information...
1 parent 5784455 commit 51837148f764d6c114687a7ed9eeb40b52c84ad3 @jasonlcrane jasonlcrane committed with ChrisMcKee Jan 24, 2012
Showing with 12 additions and 0 deletions.
  1. +4 −0 src/assets/photoswipe.css
  2. +7 −0 src/toolbar.class.js
  3. +1 −0 src/toolbar.js
View
4 src/assets/photoswipe.css
@@ -159,6 +159,10 @@ div.ps-toolbar-play div.ps-toolbar-content
{
background-position: -88px 0;
}
+div.ps-toolbar-play-disabled div.ps-toolbar-content
+{
+ background-position: -88px -44px;
+}
/* Hi-res display */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
View
7 src/toolbar.class.js
@@ -455,11 +455,18 @@
Util.DOM.removeClass(this.previousEl, PhotoSwipe.Toolbar.CssClasses.previousDisabled);
Util.DOM.removeClass(this.nextEl, PhotoSwipe.Toolbar.CssClasses.nextDisabled);
+ Util.DOM.removeClass(this.playEl, PhotoSwipe.Toolbar.CssClasses.playDisabled);
if (index > 0 && index < this.cache.images.length-1){
return;
}
+ if (index === 0 && index === this.cache.images.length-1){
+ if (!Util.isNothing(this.playEl)){
+ Util.DOM.addClass(this.playEl, PhotoSwipe.Toolbar.CssClasses.playDisabled);
+ }
+ }
+
if (index === 0){
if (!Util.isNothing(this.previousEl)){
Util.DOM.addClass(this.previousEl, PhotoSwipe.Toolbar.CssClasses.previousDisabled);
View
1 src/toolbar.js
@@ -18,6 +18,7 @@
captionContent: 'ps-caption-content',
close: 'ps-toolbar-close',
play: 'ps-toolbar-play',
+ playDisabled: 'ps-toolbar-play-disabled',
previous: 'ps-toolbar-previous',
previousDisabled: 'ps-toolbar-previous-disabled',
next: 'ps-toolbar-next',

0 comments on commit 5183714

Please sign in to comment.