async: false,
success: function( versions ) {
+ // first decide which kind of dialog we need
if (versions) {
var html = '<div id="dropdown" class="drop drop-versions" data-file="'+escapeHTML(files)+'">';
html += '<input type="button" value="All versions..." name="makelink" id="makelink" />';
html += '<input id="link" style="display:none; width:90%;" />';
- $.each( versions, function(index, row ) {
- addVersion( row );
- });
} else {
var html = '<div id="dropdown" class="drop drop-versions" data-file="'+escapeHTML(files)+'">';
html += '<div style="text-align:center;">No other versions available</div></div>';
$(html).appendTo($('thead .share'));
}
+ // if versions are available populate the dialog
+ if (versions) {
+ $.each( versions, function(index, row ) {
+ addVersion( row );
+ });
+ }
+
$('#found_versions').change(function(){
var revision=parseInt($(this).val());
revertFile(files,revision);