Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix WebODF sizing and unnecessary buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Sep 5, 2016
1 parent 756fa07 commit 5bf3f23
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 33 deletions.
51 changes: 22 additions & 29 deletions core/src/plugins/editor.webodf/class.WebodfEditor.js
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions core/src/plugins/editor.webodf/manifest.xml
Expand Up @@ -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>
Expand Down

0 comments on commit 5bf3f23

Please sign in to comment.