]> source.dussan.org Git - nextcloud-server.git/commitdiff
don't try to register file actions when we're not in the files app
authorRobin Appelman <icewind@owncloud.com>
Wed, 2 May 2012 21:26:41 +0000 (23:26 +0200)
committerRobin Appelman <icewind@owncloud.com>
Wed, 2 May 2012 21:26:57 +0000 (23:26 +0200)
apps/files_versions/js/versions.js

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