Skip to content
Snippets Groups Projects
Commit 122d1efe authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Don't show the select form in the history dropdown if a file has no other versions

parent 0df376d4
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment