Fixed slideshow issue
authorMarcel Werk <burntime@woltlab.com>
Sat, 26 Oct 2013 17:24:51 +0000 (19:24 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sat, 26 Oct 2013 17:24:51 +0000 (19:24 +0200)
wcfsetup/install/files/js/WCF.js

index baaf1ca90457c05a65d274162ed8291d867db586..6a36492a6b6d8708c8b27a4b56987df701595dd7 100755 (executable)
@@ -9154,7 +9154,9 @@ $.widget('ui.wcfSlideshow', {
                this._count = this._items.length;
                this._index = 0;
                
-               this._initSlideshow();
+               if (this._count > 1) {
+                       this._initSlideshow();
+               }
        },
        
        /**
@@ -9181,18 +9183,16 @@ $.widget('ui.wcfSlideshow', {
                }).hover($.proxy(this._hoverIn, this), $.proxy(this._hoverOut, this));
                
                // create toggle buttons
-               if (this._items.length > 1) {
-                       this._buttonList = $('<ul class="slideshowButtonList" />').appendTo(this.element);
-                       for (var $i = 0; $i < this._count; $i++) {
-                               var $link = $('<li><a><span class="icon icon16 icon-circle" /></a></li>').data('index', $i).click($.proxy(this._click, this)).appendTo(this._buttonList);
-                               if ($i == 0) {
-                                       $link.find('.icon').addClass('active');
-                               }
+               this._buttonList = $('<ul class="slideshowButtonList" />').appendTo(this.element);
+               for (var $i = 0; $i < this._count; $i++) {
+                       var $link = $('<li><a><span class="icon icon16 icon-circle" /></a></li>').data('index', $i).click($.proxy(this._click, this)).appendTo(this._buttonList);
+                       if ($i == 0) {
+                               $link.find('.icon').addClass('active');
                        }
-                       
-                       this._resetTimer();
                }
                
+               this._resetTimer();
+               
                $(window).resize($.proxy(this._resize, this));
        },