From 61afb431dac308d7e5aea03c887c7a4c5f2c3aa5 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Wed, 18 Sep 2013 19:15:37 +0300 Subject: [PATCH] Empty folder message is back --- css/style.css | 6 ++++-- js/documents.js | 14 ++++++++++++-- templates/documents.php | 2 -- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/css/style.css b/css/style.css index 4535de19..2136f4be 100755 --- a/css/style.css +++ b/css/style.css @@ -1,5 +1,7 @@ -#emptyfolder { - position:absolute; margin:10em 0 0 10em; +#documents-content #emptyfolder { + position: static; + margin:0; + text-align:center; font-size:1.5em; font-weight:bold; color:#888; text-shadow:#fff 0 1px 0; } diff --git a/js/documents.js b/js/documents.js index c2e93c70..819853d8 100644 --- a/js/documents.js +++ b/js/documents.js @@ -272,7 +272,8 @@ var documentsMain = { }, renderDocuments: function () { - var self = this; + var self = this, + hasDocuments = false; //remove all but template $('.documentslist .document:not(.template)').remove(); @@ -290,6 +291,7 @@ var documentsMain = { $('.documentslist').append(docElem); docElem.show(); + hasDocuments = true; }); jQuery.each(this._sessions, function(i,session){ if (self._members[session.es_id].length > 0) { @@ -303,6 +305,15 @@ var documentsMain = { } } }); + + if (!hasDocuments){ + $('#documents-content').append('
' + + t('documents', 'No documents are found. Please upload or create a document!') + + '
' + ); + } else { + $('#emptyfolder').remove(); + } } }; @@ -336,7 +347,6 @@ $(document).ready(function() { documentsMain.show(); var file_upload_start = $('#file_upload_start'); file_upload_start.on('fileuploaddone', documentsMain.show); - //TODO show "no docs, please upload" //TODO when ending a session as the last user close session? OC.addScript('documents', '3rdparty/webodf/webodf_bootstrap', documentsMain.onStartup); diff --git a/templates/documents.php b/templates/documents.php index 942c5cee..32b8f73b 100755 --- a/templates/documents.php +++ b/templates/documents.php @@ -1,5 +1,3 @@ -
-