summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2012-05-18 10:39:43 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2012-05-18 10:39:43 -0400
commit122d1efecfec75eab6f47d8456685c6ce133dea9 (patch)
treec26a4e9b6545fe2a6cb4b89f9f243729817ad49c /apps/files_versions
parent0df376d4721d015947b7e05b71fddd65791fad43 (diff)
downloadnextcloud-server-122d1efecfec75eab6f47d8456685c6ce133dea9.tar.gz
nextcloud-server-122d1efecfec75eab6f47d8456685c6ce133dea9.zip
Don't show the select form in the history dropdown if a file has no other versions
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/js/versions.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js
index d80b95556c7..8638d3ee428 100644
--- a/apps/files_versions/js/versions.js
+++ b/apps/files_versions/js/versions.js
@@ -29,13 +29,12 @@ function createVersionsDropdown(filename, files) {
var html = '<div id="dropdown" class="drop" data-file="'+files+'">';
html += '<div id="private">';
- html += '<select data-placeholder="Saved versions" id="found_versions" class="chzen-select">';
+ html += '<select data-placeholder="Saved versions" id="found_versions" class="chzen-select" style="width:16em;">';
html += '<option value=""></option>';
html += '</select>';
html += '</div>';
//html += '<input type="button" value="Revert file" onclick="revertFile()" />';
html += '<input type="button" value="All versions..." onclick="window.location=\''+historyUrl+'\'" name="makelink" id="makelink" />';
- html += '<br />';
html += '<input id="link" style="display:none; width:90%;" />';
if (filename) {
@@ -56,11 +55,14 @@ function createVersionsDropdown(filename, files) {
//alert("helo "+OC.linkTo('files_versions', 'ajax/getVersions.php'));
if (versions) {
-
$.each( versions, function(index, row ) {
addVersion( row );
});
-
+ $('#found_versions').chosen();
+ } else {
+ $('#found_versions').hide();
+ $('#makelink').hide();
+ $('<div style="text-align:center;">No other versions available</div>').appendTo('#dropdown');
}
$('#found_versions').change(function(){
var revision=parseInt($(this).val());
@@ -113,6 +115,6 @@ function createVersionsDropdown(filename, files) {
}
$('#dropdown').show('blind');
- $('#found_versions').chosen();
+
}