From c49dc3337cebaff25f8ecf17b8a517c44dbceec5 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Tue, 4 Aug 2015 14:21:30 +0300 Subject: [PATCH] Rename variable. Fixes #505 --- js/viewer/viewer.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/viewer/viewer.js b/js/viewer/viewer.js index b57c2d21..81897307 100644 --- a/js/viewer/viewer.js +++ b/js/viewer/viewer.js @@ -52,22 +52,22 @@ var odfViewer = { }, onEdit : function(fileName, context){ - var location, - fileId = context.$file.attr('data-id'); + var fileId = context.$file.attr('data-id'); window.location = OC.linkTo('documents', 'index.php') + '#' + fileId; }, onView: function(filename) { - var attachTo = odfViewer.isDocuments ? '#documents-content' : '#controls', + var fileloc, + attachTo = odfViewer.isDocuments ? '#documents-content' : '#controls', attachToolbarTo = odfViewer.isDocuments ? '#content-wrapper' : '#controls'; if (odfViewer.isDocuments){ //Documents view - location = filename; + fileloc = filename; } else { //Public page, files app, etc var dirName = $('#dir').val()!='/' ? $('#dir').val() + '/' : '/'; - location = OC.filePath('documents', 'ajax', 'download.php') + '?path=' + fileloc = OC.filePath('documents', 'ajax', 'download.php') + '?path=' + encodeURIComponent(dirName) + encodeURIComponent(filename) + '&requesttoken=' + encodeURIComponent(oc_requesttoken); OC.addStyle('documents', '3rdparty/webodf/wodotexteditor'); @@ -97,7 +97,7 @@ var odfViewer = { var odfelement = document.getElementById("odf-canvas"); var odfcanvas = new odf.OdfCanvas(odfelement); - odfcanvas.load(location); + odfcanvas.load(fileloc); }); },