Rename variable. Fixes #505

This commit is contained in:
Victor Dubiniuk 2015-08-04 14:21:30 +03:00
parent d4b1006cfa
commit c49dc3337c

View File

@ -52,22 +52,22 @@ var odfViewer = {
}, },
onEdit : function(fileName, context){ onEdit : function(fileName, context){
var location, var fileId = context.$file.attr('data-id');
fileId = context.$file.attr('data-id');
window.location = OC.linkTo('documents', 'index.php') + '#' + fileId; window.location = OC.linkTo('documents', 'index.php') + '#' + fileId;
}, },
onView: function(filename) { onView: function(filename) {
var attachTo = odfViewer.isDocuments ? '#documents-content' : '#controls', var fileloc,
attachTo = odfViewer.isDocuments ? '#documents-content' : '#controls',
attachToolbarTo = odfViewer.isDocuments ? '#content-wrapper' : '#controls'; attachToolbarTo = odfViewer.isDocuments ? '#content-wrapper' : '#controls';
if (odfViewer.isDocuments){ if (odfViewer.isDocuments){
//Documents view //Documents view
location = filename; fileloc = filename;
} else { } else {
//Public page, files app, etc //Public page, files app, etc
var dirName = $('#dir').val()!='/' ? $('#dir').val() + '/' : '/'; 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) + encodeURIComponent(dirName) + encodeURIComponent(filename)
+ '&requesttoken=' + encodeURIComponent(oc_requesttoken); + '&requesttoken=' + encodeURIComponent(oc_requesttoken);
OC.addStyle('documents', '3rdparty/webodf/wodotexteditor'); OC.addStyle('documents', '3rdparty/webodf/wodotexteditor');
@ -97,7 +97,7 @@ var odfViewer = {
var odfelement = document.getElementById("odf-canvas"); var odfelement = document.getElementById("odf-canvas");
var odfcanvas = new odf.OdfCanvas(odfelement); var odfcanvas = new odf.OdfCanvas(odfelement);
odfcanvas.load(location); odfcanvas.load(fileloc);
}); });
}, },