don't try to register file actions when we're not in the files app

This commit is contained in:
Robin Appelman 2012-05-02 23:26:41 +02:00
parent 47081a2471
commit 4ba527625f
1 changed files with 21 additions and 21 deletions

View File

@ -9,30 +9,30 @@ $(document).ready(function() {
}); });
$(document).ready(function(){ $(document).ready(function(){
if (typeof FileActions !== 'undefined') {
// Add history button to files/index.php
FileActions.register('file','History',function(){return OC.imagePath('core','actions/history')},function(filename){
// Add history button to files/index.php if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback
FileActions.register('file','History',function(){return OC.imagePath('core','actions/history')},function(filename){
if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback var file = $('#dir').val()+'/'+filename;
var file = $('#dir').val()+'/'+filename; createVersionsDropdown(filename, file)
createVersionsDropdown(filename, file) $.ajax({
type: 'GET',
$.ajax({ url: OC.linkTo('files_versions', 'ajax/getVersions.php'),
type: 'GET', dataType: 'json',
url: OC.linkTo('files_versions', 'ajax/getVersions.php'), data: {source: file},
dataType: 'json', async: false,
data: {source: file}, success: function(versions) {
async: false, if (versions) {
success: function(versions) { }
if (versions) {
} }
} });
}); });
}
});
}); });
function createVersionsDropdown(filename, files) { function createVersionsDropdown(filename, files) {