Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/apps.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-10-18 17:23:28 +0400
committerVincent Petry <pvince81@owncloud.com>2013-10-22 18:57:26 +0400
commite1e5b047ba179cb44b762651cd8ccd18decb7d6f (patch)
treefd3c3c0a13b3d94b6b84267090352a324462b0ca /files_odfviewer
parent826f96c988ad48b7712b58035ead29022be05e20 (diff)
Now using FileList.setViewerMode in embeded apps
Text editor and ODF viewer now use FileList.setViewerMode() calls to make sure the controls bar is restored properly to its previous state upon closing.
Diffstat (limited to 'files_odfviewer')
-rw-r--r--files_odfviewer/css/odfviewer.css2
-rw-r--r--files_odfviewer/js/viewer.js47
2 files changed, 20 insertions, 29 deletions
diff --git a/files_odfviewer/css/odfviewer.css b/files_odfviewer/css/odfviewer.css
index 551f1c104..c43819070 100644
--- a/files_odfviewer/css/odfviewer.css
+++ b/files_odfviewer/css/odfviewer.css
@@ -1,6 +1,6 @@
#odf-canvas{
position: relative;
- top: 37px;
+ top: 44px;
left: 1px;
border:1px solid darkgray;
box-shadow: 0px 4px 10px #000;
diff --git a/files_odfviewer/js/viewer.js b/files_odfviewer/js/viewer.js
index f5bcaafcf..faaba2b64 100644
--- a/files_odfviewer/js/viewer.js
+++ b/files_odfviewer/js/viewer.js
@@ -4,41 +4,32 @@ function viewOdf(dir, file) {
OC.addScript('files_odfviewer','webodf').done(function(){
var location = fileDownloadPath(dir, file);
- // fade out files menu and add odf menu
- $('.actions,#file_action_panel').fadeOut('slow').promise().done(function() {
- // odf action toolbar
- var odfToolbarHtml =
- '<div id="odf-toolbar">' +
- '<button id="odf_close">'+t('files_odfviewer','Close')+
- '</button></div>';
- $('#controls').append(odfToolbarHtml);
+ // start viewer mode
+ FileList.setViewerMode(true);
- });
+ // odf action toolbar
+ var odfToolbarHtml =
+ '<div id="odf-toolbar">' +
+ '<button id="odf_close">'+t('files_odfviewer','Close')+
+ '</button></div>';
+ $('#controls').append(odfToolbarHtml);
- // fade out file list and show pdf canvas
- $('table').fadeOut('slow').promise().done(function(){;
- var canvashtml = '<div id="odf-canvas"></div>';
- $('table').after(canvashtml);
- // in case we are on the public sharing page we shall display the odf into the preview tag
- $('#preview').html(canvashtml);
+ var canvashtml = '<div id="odf-canvas"></div>';
+ $('table').after(canvashtml);
+ // in case we are on the public sharing page we shall display the odf into the preview tag
+ $('#preview').html(canvashtml);
- var odfelement = document.getElementById("odf-canvas");
- var odfcanvas = new odf.OdfCanvas(odfelement);
- odfcanvas.load(location);
- });
+ var odfelement = document.getElementById("odf-canvas");
+ var odfcanvas = new odf.OdfCanvas(odfelement);
+ odfcanvas.load(location);
});
}
function closeOdfViewer(){
- // Fade out odf-toolbar
- $('#odf-toolbar').fadeOut('slow');
- // Fade out editor
- $('#odf-canvas').fadeOut('slow', function(){
- $('#odf-toolbar').remove();
- $('#odf-canvas').remove();
- $('.actions,#file_access_panel').fadeIn('slow');
- $('table').fadeIn('slow');
- });
+ // Remove odf-toolbar
+ $('#odf-toolbar').remove();
+ $('#odf-canvas').remove();
+ FileList.setViewerMode(false);
is_editor_shown = false;
}