issue 671 added function of editor resize by contents height

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10316 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
devjin 2012-03-05 09:04:39 +00:00
parent 5c1edd8868
commit f8dd9888f6
5 changed files with 109 additions and 24 deletions

View file

@ -5047,6 +5047,44 @@ xe.XE_EditingModeToggler = $.Class({
}
}
});
xe.XE_Editorresize = $.Class({
name : "XE_Editorresize",
$init : function(elAppContainer, oWYSIWYGIFrame){
this.inputArea = $('.xpress_xeditor_editing_area_container', elAppContainer).get(0);
this.oVerticalResizer = $('.xpress_xeditor_editingArea_verticalResizer', elAppContainer).get(0);
this.oCheckBox = $('#editorresize', elAppContainer).get(0);
this.oIframe = oWYSIWYGIFrame;
var self = this;
$(oWYSIWYGIFrame).load(function(){
self.oIframeBody = $(oWYSIWYGIFrame).contents().find('body');
});
},
$ON_MSG_APP_READY : function(){
this.oApp.registerBrowserEvent(this.oCheckBox, 'change', 'XE_TOGGLE_EDITOR_RESIZE');
},
$ON_XE_TOGGLE_EDITOR_RESIZE : function(){
if(this.oCheckBox.checked == true){
if(this._prevHeight == undefined)
this._prevHeight = this.inputArea.style.height;
this.oVerticalResizer.style.display = 'none';
this.oApp.registerBrowserEvent(this.oIframeBody, 'keydown', 'XE_EDITOR_RESIZE');
this.inputArea.style.height = this.oIframe.style.height = this.oIframeBody[0].scrollHeight + 'px';
}else{
$(this.oIframeBody).unbind('keydown');
this.oVerticalResizer.style.display = 'block';
this.inputArea.style.height = this._prevHeight;
this.oIframe.style.height = this._prevHeight;
}
},
$ON_XE_EDITOR_RESIZE : function(){
this.inputArea.style.height = this.oIframe.style.height = this.oIframeBody[0].scrollHeight + 'px';
}
});
//}
/**
* @fileOverview This file contains a message mapping(Korean), which is used to map the message code to the actual message
@ -5867,7 +5905,9 @@ function editorStart_xe(editor_sequence, primary_key, content_key, editor_height
oEditor.registerPlugin(new xe.XE_EditingModeToggler(elAppContainer));
}
if(jQuery("#editorresize").length) {
oEditor.registerPlugin(new xe.XE_Editorresize(elAppContainer, oWYSIWYGIFrame));
}
//oEditor.registerPlugin(new xe.XE_Preview(elAppContainer));
if (!jQuery.browser.msie && !jQuery.browser.opera) {