From 98a485d46f2913dc25e7a0c02701696d532b89c2 Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Sat, 31 Oct 2015 18:21:59 -0400 Subject: [PATCH] cloudsuite: add FileList.findfile --- js/documents.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/js/documents.js b/js/documents.js index d2610ead..3732d7ff 100644 --- a/js/documents.js +++ b/js/documents.js @@ -646,7 +646,25 @@ FileList.getCurrentDirectory = function(){ FileList.highlightFiles = function(files, highlightFunction) { }; +FileList.findFile = function(filename) { + var documents = documentsMain.docs.documentGrid('option').documents; + return _.find(documents, function(aFile) { + return (aFile.name === filename); + }) || false; +}; + $(document).ready(function() { + + if (!OCA.Files) { + OCA.Files = {}; + OCA.Files.App = {}; + OCA.Files.App.fileList = FileList; + } + + if (!OC.Share) { + OC.Share = {}; + } + documentsMain.docs = $('.documentslist').documentGrid(); documentsMain.overlay = $('
').documentOverlay();