Disable play mode if less than 2 images are present
authorAlexander Ebert <ebert@woltlab.com>
Tue, 28 Oct 2014 11:13:18 +0000 (12:13 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 28 Oct 2014 11:13:18 +0000 (12:13 +0100)
wcfsetup/install/files/js/WCF.ImageViewer.js

index 2ef5d5e0eae2b9cdb47da1ca017b8be2620d7e8b..4697f20e9aa204536568d98d7d2365877e562cf5 100644 (file)
@@ -787,6 +787,10 @@ $.widget('ui.wcfImageViewer', {
                $slideshowButtonPrevious.click($.proxy(this._previousImage, this));
                $slideshowButtonEnlarge.click($.proxy(this._toggleView, this));
                $slideshowButtonToggle.click($.proxy(function() {
+                       if (this._items < 2) {
+                               return;
+                       }
+                       
                        if (this._slideshowEnabled) {
                                this.stopSlideshow(true);
                        }
@@ -1022,6 +1026,10 @@ $.widget('ui.wcfImageViewer', {
                else {
                        this._ui.slideshow.next.removeClass('pointer');
                }
+               
+               if (this._items < 2) {
+                       this._ui.slideshow.toggle.removeClass('pointer');
+               }
        },
        
        /**