diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2014-12-31 00:14:02 +0100 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2015-01-02 10:28:42 +0100 |
commit | 66cf17b32bd10bdaacc2bd3ae383c0100cdf73bd (patch) | |
tree | 2446a2bcea935a03470b7be5e8a72fa961b8cfa4 /apps/files | |
parent | 0c55ef1a3015dae625b34a239c1a0cdba9aece93 (diff) | |
download | nextcloud-server-66cf17b32bd10bdaacc2bd3ae383c0100cdf73bd.tar.gz nextcloud-server-66cf17b32bd10bdaacc2bd3ae383c0100cdf73bd.zip |
don't use full class name to register plugin
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/js/search.js | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/apps/files/js/search.js b/apps/files/js/search.js index 669def85d85..15a4649de81 100644 --- a/apps/files/js/search.js +++ b/apps/files/js/search.js @@ -8,7 +8,25 @@ * */ (function() { - OCA.Search.Files = { + + /** + * Construct a new FileActions instance + * @constructs Files + */ + var Files = function() { + this.initialize(); + }; + /** + * @memberof OCA.Search + */ + Files.prototype = { + + /** + * Initialize the file search + */ + initialize: function() { + OC.Plugins.register('OCA.Search', this); + }, attach: function(search) { search.setFilter('files', function (query) { if (OCA.Search.Files.fileAppLoaded()) { @@ -48,7 +66,7 @@ show size and last modified date on the right */ OCA.Search.Files.updateLegacyMimetype(result); - $pathDiv = $('<div class="path"></div>').text(result.path); + var $pathDiv = $('<div class="path"></div>').text(result.path); $row.find('td.info div.name').after($pathDiv).text(result.name); $row.find('td.result a').attr('href', result.link); @@ -96,11 +114,7 @@ return $row; }, inFileList: function($row, result){ - if (OCA.Search.Files.fileAppLoaded() && OCA.Files.App.fileList.inList(result.name)) { - return true; - } else { - return false; - } + return OCA.Search.Files.fileAppLoaded() && OCA.Files.App.fileList.inList(result.name); }, updateLegacyMimetype: function(result){ // backward compatibility: @@ -132,4 +146,3 @@ }; })(); -OC.Plugins.register('OCA.Search', OCA.Search.Files); |