Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/gallery.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-07-17 16:12:52 +0400
committerRobin Appelman <icewind@owncloud.com>2014-07-17 16:13:21 +0400
commit48057f5d028c2fe2ae825f5dd5c6854e29809872 (patch)
treee8781310f8c122227bb8f1f054284fcfd93dfce2
parent7f9b3462d4ec783b715087b51c1b97be2bca4f50 (diff)
show loading message instead of empty message when loadingv7.0.0RC3
-rw-r--r--css/styles.css9
-rw-r--r--js/gallery.js33
-rw-r--r--templates/index.php1
3 files changed, 32 insertions, 11 deletions
diff --git a/css/styles.css b/css/styles.css
index 981bbc9d..b618c144 100644
--- a/css/styles.css
+++ b/css/styles.css
@@ -112,3 +112,12 @@ button.share {
margin-right: 0;
border-bottom-right-radius: 0;
}
+
+#loading {
+ font-size: 16px;
+ color: #888;
+ position: absolute;
+ text-align: center;
+ top: 30%;
+ width: 100%;
+}
diff --git a/js/gallery.js b/js/gallery.js
index 8fedd3f2..5397a3fc 100644
--- a/js/gallery.js
+++ b/js/gallery.js
@@ -97,7 +97,7 @@ Gallery.view = {};
Gallery.view.element = null;
Gallery.view.clear = function () {
Gallery.view.element.empty();
- Gallery.toggleControls(false);
+ Gallery.showLoading();
};
Gallery.view.cache = {};
@@ -169,7 +169,7 @@ Gallery.view.loadVisibleRows = function (album, path) {
return; //throw away the row if the user has navigated away in the meantime
}
if (Gallery.view.element.length == 1) {
- Gallery.toggleControls(true);
+ Gallery.showNormal();
}
Gallery.view.element.append(dom);
if (album.viewedItems < album.subAlbums.length + album.images.length && Gallery.view.element.height() < targetHeight) {
@@ -196,21 +196,32 @@ Gallery.view.pushBreadCrumb = function (text, path) {
});
};
-Gallery.toggleControls = function(toggle) {
- if (toggle) {
- $('#emptycontent').addClass('hidden');
- $('#controls').removeClass('hidden');
- } else {
- $('#controls').addClass('hidden');
- $('#emptycontent').removeClass('hidden');
- }
+Gallery.showEmpty = function () {
+ $('#controls').addClass('hidden');
+ $('#emptycontent').removeClass('hidden');
+ $('#loading').addClass('hidden');
+};
+
+Gallery.showLoading = function () {
+ $('#emptycontent').addClass('hidden');
+ $('#controls').removeClass('hidden');
+ $('#loading').removeClass('hidden');
+};
+
+Gallery.showNormal = function () {
+ $('#emptycontent').addClass('hidden');
+ $('#controls').removeClass('hidden');
+ $('#loading').addClass('hidden');
};
$(document).ready(function () {
- Gallery.toggleControls(false);
+ Gallery.showLoading();
Gallery.view.element = $('#gallery');
Gallery.fillAlbums().then(function () {
+ if(Gallery.images.length === 0) {
+ Gallery.showEmpty();
+ }
OC.Breadcrumb.container = $('#breadcrumbs');
window.onhashchange();
$('button.share').click(Gallery.share);
diff --git a/templates/index.php b/templates/index.php
index 0edbea61..8f5b1ff6 100644
--- a/templates/index.php
+++ b/templates/index.php
@@ -9,5 +9,6 @@
<div id="gallery" class="hascontrols"></div>
<div id="emptycontent" class="hidden"><?php p($l->t("No pictures found! If you upload pictures in the files app, they will be displayed here.")); ?></div>
+<div id="loading" class="hidden"><?php p($l->t("Loading...")); ?></div>
<input type="hidden" name="allowShareWithLink" id="allowShareWithLink" value="yes" />