Permalink
Browse files

Fix WebODF sizing and unnecessary buttons

  • Loading branch information...
1 parent 756fa07 commit 5bf3f231f91ab42ab9bc8e2a78fac5749de4d43a @cdujeu cdujeu committed Sep 5, 2016
Showing with 23 additions and 33 deletions.
  1. +22 −29 core/src/plugins/editor.webodf/class.WebodfEditor.js
  2. +1 −4 core/src/plugins/editor.webodf/manifest.xml
@@ -22,34 +22,7 @@ Class.create("WebodfEditor", AbstractEditor, {
padID:null,
sessionID: null,
node: null,
-
- initialize: function($super, oFormObject, options)
- {
- $super(oFormObject, options);
- if(!ajaxplorer.user || ajaxplorer.user.canWrite()){
- this.canWrite = true;
- this.actions.get("saveButton").observe('click', function(){
- this.saveFile();
- return false;
- }.bind(this));
- }else{
- this.canWrite = false;
- this.actions.get("saveButton").hide();
- }
- // HIDE SAVE FOR THE MOMENT
- this.actions.get("saveButton").hide();
-
- if(options.context.__className == "Modal"){
- this.actions.get("downloadFileButton").observe('click', function(){
- if(!this.currentFile) return false;
- PydioApi.triggerDownload(ajxpBootstrap.parameters.get('ajxpServerAccess')+'&action=download&file='+this.currentFile);
- return false;
- }.bind(this));
- }else{
- this.actions.get("downloadFileButton").hide();
- }
- },
-
+
open : function($super, nodeOrNodes){
$super(nodeOrNodes);
this.node = nodeOrNodes;
@@ -70,7 +43,27 @@ Class.create("WebodfEditor", AbstractEditor, {
},
-
+
+ resize : function(size){
+ if(size){
+ this.contentMainContainer.setStyle({height:size+'px'});
+ if(this.IEorigWidth) this.contentMainContainer.setStyle({width:this.IEorigWidth});
+ }else{
+ if(this.fullScreenMode){
+ fitHeightToBottom(this.contentMainContainer, this.element);
+ if(this.IEorigWidth) this.contentMainContainer.setStyle({width:this.element.getWidth()});
+ }else{
+ if(this.editorOptions.context.elementName){
+ fitHeightToBottom(this.contentMainContainer, $(this.editorOptions.context.elementName), 5);
+ }else{
+ fitHeightToBottom($(this.element));
+ fitHeightToBottom($(this.contentMainContainer), $(this.element));
+ }
+ if(this.IEorigWidth) this.contentMainContainer.setStyle({width:this.IEorigWidth});
+ }
+ }
+ this.element.fire("editor:resize", size);
+ },
saveFile : function(){
if(!this.padID || !this.node) return;
@@ -11,10 +11,7 @@
</client_settings>
<clientForm id="webodf_box"><![CDATA[
<div id="webodf_box" box_width="80%" box_height="90%" box_padding="0" class="editor_container">
- <div class="action_bar">
- <a href="#" onclick="return false;" class="icon-save" id="saveButton" onclick="saveForm();return false;"><img src="AJXP_THEME_FOLDER/images/actions/22/filesave.png" width="22" height="22" alt="AJXP_MESSAGE[53]" border="0"><br><span message_id="53">AJXP_MESSAGE[53]</span></a>
- <a href="#" onclick="return false;" class="icon-download" id="downloadFileButton"><img width="22" height="22" src="AJXP_THEME_FOLDER/images/actions/22/download_manager.png" alt="AJXP_MESSAGE[88]" border="0"><br><span message_id="88">AJXP_MESSAGE[88]</span></a>
- </div>
+ <div class="action_bar"></div>
<iframe id="webodf_container" style="border:0; width:100%;"></iframe>
</div>
]]></clientForm>

0 comments on commit 5bf3f23

Please sign in to comment.