Fixed bug oc-1659 - history dialogue cannot be closed once opened
This commit is contained in:
parent
0fe3354c61
commit
9bfdf47cd4
|
@ -11,8 +11,16 @@ $(document).ready(function() {
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
if (typeof FileActions !== 'undefined') {
|
if (typeof FileActions !== 'undefined') {
|
||||||
// Add history button to files/index.php
|
// Add history button to files/index.php
|
||||||
FileActions.register('file','History', OC.PERMISSION_UPDATE, function(){return OC.imagePath('core','actions/history');},function(filename){
|
FileActions.register(
|
||||||
|
'file'
|
||||||
|
,'History'
|
||||||
|
, OC.PERMISSION_UPDATE
|
||||||
|
, function() {
|
||||||
|
// Specify icon for hitory button
|
||||||
|
return OC.imagePath('core','actions/history');
|
||||||
|
}
|
||||||
|
,function(filename){
|
||||||
|
// Action to perform when clicked
|
||||||
if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback
|
if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback
|
||||||
|
|
||||||
var file = $('#dir').val()+'/'+filename;
|
var file = $('#dir').val()+'/'+filename;
|
||||||
|
@ -28,7 +36,8 @@ $(document).ready(function(){
|
||||||
} else {
|
} else {
|
||||||
createVersionsDropdown(filename, file);
|
createVersionsDropdown(filename, file);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -42,7 +51,6 @@ function createVersionsDropdown(filename, files) {
|
||||||
html += '<option value=""></option>';
|
html += '<option value=""></option>';
|
||||||
html += '</select>';
|
html += '</select>';
|
||||||
html += '</div>';
|
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 += '<input type="button" value="All versions..." onclick="window.location=\''+historyUrl+'\'" name="makelink" id="makelink" />';
|
||||||
html += '<input id="link" style="display:none; width:90%;" />';
|
html += '<input id="link" style="display:none; width:90%;" />';
|
||||||
|
|
||||||
|
@ -61,8 +69,6 @@ function createVersionsDropdown(filename, files) {
|
||||||
async: false,
|
async: false,
|
||||||
success: function( versions ) {
|
success: function( versions ) {
|
||||||
|
|
||||||
//alert("helo "+OC.linkTo('files_versions', 'ajax/getVersions.php'));
|
|
||||||
|
|
||||||
if (versions) {
|
if (versions) {
|
||||||
$.each( versions, function(index, row ) {
|
$.each( versions, function(index, row ) {
|
||||||
addVersion( row );
|
addVersion( row );
|
||||||
|
@ -103,7 +109,7 @@ function createVersionsDropdown(filename, files) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addVersion(revision ) {
|
function addVersion( revision ) {
|
||||||
name=formatDate(revision.version*1000);
|
name=formatDate(revision.version*1000);
|
||||||
var version=$('<option/>');
|
var version=$('<option/>');
|
||||||
version.attr('value',revision.version);
|
version.attr('value',revision.version);
|
||||||
|
@ -123,7 +129,22 @@ function createVersionsDropdown(filename, files) {
|
||||||
version.appendTo('#found_versions');
|
version.appendTo('#found_versions');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('tr').filterAttr('data-file',filename).addClass('mouseOver');
|
||||||
$('#dropdown').show('blind');
|
$('#dropdown').show('blind');
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(this).click(
|
||||||
|
function(event) {
|
||||||
|
|
||||||
|
if ($('#dropdown').has(event.target).length === 0) {
|
||||||
|
$('#dropdown').hide('blind', function() {
|
||||||
|
$('#dropdown').remove();
|
||||||
|
$('tr').removeClass('mouseOver');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
Loading…
Reference in New Issue