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

Commit

Permalink
Fix #342 Source editor was broken in modal mode + detect BASE tag if …
Browse files Browse the repository at this point in the history
…defined to recompute correct URLS in minisite.
  • Loading branch information
cdujeu committed Dec 14, 2013
1 parent c130953 commit 9f3eaf8
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions core/src/plugins/editor.codemirror/class.CodeMirrorEditor.js
Expand Up @@ -106,6 +106,8 @@ Class.create("CodeMirrorEditor", AbstractEditor, {
var path = 'plugins/editor.codemirror/CodeMirror/';
if(window.ajxpBootstrap.parameters.get("SERVER_PREFIX_URI")){
path = window.ajxpBootstrap.parameters.get("SERVER_PREFIX_URI")+"plugins/editor.codemirror/CodeMirror/";
}else if($$('base').length){
path = $$('base')[0].readAttribute('href')+"plugins/editor.codemirror/CodeMirror/";
}
var extension = getFileExtension(fileName);
var parserFile; var styleSheet;
Expand Down Expand Up @@ -221,9 +223,15 @@ Class.create("CodeMirrorEditor", AbstractEditor, {

this.element.observe("editor:resize", function(event){
if(this.goingToFullScreen) return;
fitHeightToBottom($(this.element));
fitHeightToBottom($(this.contentMainContainer), $(this.element));
fitHeightToBottom(this.codeMirror.wrapping, this.contentMainContainer);
if(ajaxplorer._editorOpener){
fitHeightToBottom($(this.element));
fitHeightToBottom($(this.contentMainContainer), $(this.element));
fitHeightToBottom(this.codeMirror.wrapping, this.contentMainContainer);
}else{
fitHeightToBottom($(this.contentMainContainer), $(modal.elementName));
fitHeightToBottom($(this.element), $(modal.elementName));
fitHeightToBottom(this.codeMirror.wrapping);
}
}.bind(this));

},
Expand Down Expand Up @@ -266,7 +274,12 @@ Class.create("CodeMirrorEditor", AbstractEditor, {
if(fsMode){
fitHeightToBottom($(this.contentMainContainer));
}else{
fitHeightToBottom($(this.contentMainContainer), $(this.element));
if(ajaxplorer._editorOpener){
fitHeightToBottom($(this.contentMainContainer), $(this.element));
}else{
fitHeightToBottom($(this.contentMainContainer), $(modal.elementName));
fitHeightToBottom($(this.element), $(modal.elementName));
}
}
}.bind(this), this.options);
},
Expand Down

0 comments on commit 9f3eaf8

Please sign in to comment.