cloudsuite: when click a document in FileList view, attach iframe

TODO replace file_path = documentsMain.url
pull/1/head
Henry Castro 9 years ago
parent 3809e2ee43
commit 38f9b8152e

@ -57,6 +57,26 @@ var odfViewer = {
},
onView: function(filename, context) {
var attachTo = odfViewer.isDocuments ? '#documents-content' : '#controls';
FileList.setViewerMode(true);
// TODO replace file_path = documentsMain.url
var viewer = window.location.protocol + '//' + window.location.host + '/cloudsuite/cloudsuite.html?' +
'file_path=' + context.dir + '/' + filename +
'&host=' + 'ws://' + window.location.hostname + ':9980' +
'&edit=' + 'false' +
'&timestamp=' + '';
var frame = '<iframe id="loleafletframe" style="width:100%;height:100%;display:block;position:fixed;top:46px;" src="' + viewer + '" sandbox="allow-scripts allow-same-origin allow-popups"/>';
$(attachTo).append(frame);
$('#loleafletframe').load(function(){
var iframe = $('#loleafletframe').contents();
iframe.find('#tb_toolbar-up_item_close').click(function() {
odfViewer.onClose();
});
});
},
onClose: function() {

Loading…
Cancel
Save