mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
xquared에서 Drag로 크기 조절 가능하게 함
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3053 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
40df9a7b74
commit
54903b5d0e
6 changed files with 74 additions and 61 deletions
|
|
@ -6,6 +6,12 @@ var editorAutoSaveObj = {fo_obj:null, editor_sequence:0, title:'', content:'', l
|
|||
var editorRelKeys = new Array(); ///< 에디터와 각 모듈과의 연동을 위한 key 값을 보관하는 변수
|
||||
var editorDragObj = {isDrag:false, y:0, obj:null, id:'', det:0, source_height:0}
|
||||
|
||||
/**
|
||||
* 에디터 사용시 사용되는 이벤트 연결 함수 호출
|
||||
**/
|
||||
xAddEventListener(document, 'mousedown', editorDragStart);
|
||||
xAddEventListener(document, 'mouseup', editorDragStop);
|
||||
|
||||
function editorGetContent(editor_sequence) {
|
||||
return editorRelKeys[editor_sequence]["func"](editor_sequence);
|
||||
}
|
||||
|
|
@ -70,3 +76,68 @@ function _editorAutoSave() {
|
|||
function editorRemoveSavedDoc() {
|
||||
exec_xml("editor","procEditorRemoveSavedDoc");
|
||||
}
|
||||
|
||||
/**
|
||||
* 에디터의 상태나 객체를 구하기 위한 함수
|
||||
**/
|
||||
|
||||
// editor_sequence값에 해당하는 iframe의 object를 return
|
||||
function editorGetIFrame(editor_sequence) {
|
||||
if(editorRelKeys[editor_sequence]['editor'] != undefined)
|
||||
return editorRelKeys[editor_sequence]['editor'].getFrame();
|
||||
return xGetElementById( 'editor_iframe_'+ editor_sequence );
|
||||
}
|
||||
|
||||
/**
|
||||
* iframe 세로 크기 조절 드래그 관련
|
||||
**/
|
||||
function editorDragStart(evt) {
|
||||
var e = new xEvent(evt);
|
||||
var obj = e.target;
|
||||
if(typeof(obj.id)=='undefined'||!obj.id) return;
|
||||
|
||||
var id = obj.id;
|
||||
if(id.indexOf('editor_drag_bar_')!=0) return;
|
||||
|
||||
editorDragObj.isDrag = true;
|
||||
editorDragObj.y = e.pageY;
|
||||
editorDragObj.obj = e.target;
|
||||
editorDragObj.id = id.substr('editor_drag_bar_'.length);
|
||||
|
||||
var iframe_obj = editorGetIFrame(editorDragObj.id);
|
||||
|
||||
editorDragObj.source_height = xHeight(iframe_obj);
|
||||
|
||||
xAddEventListener(document, 'mousemove', editorDragMove, false);
|
||||
xAddEventListener(editorDragObj.obj, 'mousemove', editorDragMove, false);
|
||||
}
|
||||
|
||||
function editorDragMove(evt) {
|
||||
if(!editorDragObj.isDrag) return;
|
||||
|
||||
var e = new xEvent(evt);
|
||||
var h = e.pageY - editorDragObj.y;
|
||||
|
||||
editorDragObj.isDrag = true;
|
||||
editorDragObj.y = e.pageY;
|
||||
editorDragObj.obj = e.target;
|
||||
|
||||
var iframe_obj = editorGetIFrame(editorDragObj.id);
|
||||
xHeight(iframe_obj, xHeight(iframe_obj)+h);
|
||||
xHeight(iframe_obj.parentNode, xHeight(iframe_obj)+10);
|
||||
}
|
||||
|
||||
function editorDragStop(evt) {
|
||||
if(!editorDragObj.isDrag) return;
|
||||
|
||||
xRemoveEventListener(document, 'mousemove', editorDragMove, false);
|
||||
xRemoveEventListener(editorDragObj.obj, 'mousemove', editorDragMove, false);
|
||||
|
||||
var iframe_obj = editorGetIFrame(editorDragObj.id);
|
||||
if(typeof(fixAdminLayoutFooter)=='function') fixAdminLayoutFooter(xHeight(iframe_obj)-editorDragObj.source_height);
|
||||
|
||||
editorDragObj.isDrag = false;
|
||||
editorDragObj.y = 0;
|
||||
editorDragObj.obj = null;
|
||||
editorDragObj.id = '';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue