diff options
author | Olivier Paroz <oparoz@users.noreply.github.com> | 2015-09-13 14:31:03 +0300 |
---|---|---|
committer | Olivier Paroz <oparoz@users.noreply.github.com> | 2015-09-13 14:31:03 +0300 |
commit | c5c76e5189e082ecba465739c2113da843feec90 (patch) | |
tree | 03f06d0b14b3a899dc8e4ad5f6f935c9f19096c6 /js | |
parent | 2afaef38f5ef95ef2f8539a50163ba72f96ef58e (diff) | |
parent | 2473cb2add71d48507d2c8d0870ae5714a21cf27 (diff) |
Merge pull request #319 from owncloud/remove-scrollbar
Remove unneeded scrollbar + add loading feedback
Diffstat (limited to 'js')
-rw-r--r-- | js/gallery.js | 2 | ||||
-rw-r--r-- | js/galleryrow.js | 2 | ||||
-rw-r--r-- | js/galleryview.js | 11 | ||||
-rw-r--r-- | js/slideshow.js | 2 |
4 files changed, 6 insertions, 11 deletions
diff --git a/js/gallery.js b/js/gallery.js index 7e2eb7ae..626337f4 100644 --- a/js/gallery.js +++ b/js/gallery.js @@ -272,7 +272,6 @@ showLoading: function () { $('#emptycontent').addClass('hidden'); $('#controls').removeClass('hidden'); - $('#content').addClass('icon-loading'); }, /** @@ -281,7 +280,6 @@ showNormal: function () { $('#emptycontent').addClass('hidden'); $('#controls').removeClass('hidden'); - $('#content').removeClass('icon-loading'); }, /** diff --git a/js/galleryrow.js b/js/galleryrow.js index d4e8b627..0ba65fb7 100644 --- a/js/galleryrow.js +++ b/js/galleryrow.js @@ -62,7 +62,7 @@ var scaleRatio = (this.width > this.targetWidth) ? this.targetWidth / this.width : 1; var targetHeight = 200 * scaleRatio; targetHeight = targetHeight.toFixed(3); - var row = $('<div/>').addClass('row loading'); + var row = $('<div/>').addClass('row'); /** * @param {*} row * @param {GalleryImage[]|Album[]} items diff --git a/js/galleryview.js b/js/galleryview.js index 93339fde..95118f0d 100644 --- a/js/galleryview.js +++ b/js/galleryview.js @@ -83,6 +83,7 @@ } this.clear(); + $('#loading-indicator').show(); if (albumPath !== Gallery.currentAlbum) { this.loadVisibleRows.loading = false; @@ -100,8 +101,7 @@ // Loading rows without blocking the execution of the rest of the script setTimeout(function () { this.loadVisibleRows.activeIndex = 0; - this.loadVisibleRows(Gallery.albumMap[Gallery.currentAlbum], - Gallery.currentAlbum); + this.loadVisibleRows(Gallery.albumMap[Gallery.currentAlbum], Gallery.currentAlbum); }.bind(this), 0); }, @@ -164,6 +164,7 @@ // If we've reached the end of the album, we kill the loader if (!(album.viewedItems < album.subAlbums.length + album.images.length)) { view.loadVisibleRows.loading = null; + $('#loading-indicator').hide(); return; } @@ -181,10 +182,6 @@ if (view.requestId === row.requestId) { return row.getDom().then(function (dom) { - // defer removal of loading class to trigger CSS3 animation - _.defer(function () { - dom.removeClass('loading'); - }); if (Gallery.currentAlbum !== path) { view.loadVisibleRows.loading = null; return; //throw away the row if the user has navigated away in the @@ -203,9 +200,11 @@ // No more rows to load at the moment view.loadVisibleRows.loading = null; + $('#loading-indicator').hide(); }, function () { // Something went wrong, so kill the loader view.loadVisibleRows.loading = null; + $('#loading-indicator').hide(); }); } // This is the safest way to do things diff --git a/js/slideshow.js b/js/slideshow.js index 5b809793..19f235b1 100644 --- a/js/slideshow.js +++ b/js/slideshow.js @@ -94,7 +94,6 @@ this.active = true; this.container.show(); this.container.css('background-position', 'center'); - $('html').css('overflow-y', 'hidden'); this._hideImage(); var currentImageId = index; return this.loadImage(this.images[index]).then(function (img) { @@ -187,7 +186,6 @@ * Stops the slideshow */ stop: function () { - $('html').css('overflow-y', 'scroll'); this.active = false; this.images = null; this._hideImage(); |