提交 7ab6add8 编写于 作者: U unknown

修复代理和接口在浏览器模式不能正常打开的问题

上级 945ec001
...@@ -81,22 +81,35 @@ MWF.xApplication.service.AgentDesigner.Agent = new Class({ ...@@ -81,22 +81,35 @@ MWF.xApplication.service.AgentDesigner.Agent = new Class({
this.setPropertyContent(); this.setPropertyContent();
//this.setIncludeNode(); //this.setIncludeNode();
if (this.editor){
this.editor.focus();
}else{
this.loadEditor();
}
if (this.editor.editor){ this.setAreaNodeSize();
this.editor.editor.focus();
//if (this.editor.editor){
// this.editor.editor.focus();
//this.editor.editor.navigateFileStart(); //this.editor.editor.navigateFileStart();
} //}
}.bind(this)); }.bind(this));
var _self = this;
this.page.addEvent("queryClose", function(){ this.page.addEvent("queryClose", function(){
if (this.autoSaveTimerID) window.clearInterval(this.autoSaveTimerID); if (_self.autoSaveTimerID) window.clearInterval(_self.autoSaveTimerID);
this.showIm();
//this.saveSilence(); //this.saveSilence();
if (this.lisNode) this.lisNode.setStyles(this.designer.css.listAgentItem); if (_self.lisNode) _self.lisNode.setStyles(_self.designer.css.listAgentItem);
}.bind(this)); });
this.page.tabNode.addEvent("dblclick", this.designer.maxOrReturnEditor.bind(this.designer)); this.page.tabNode.addEvent("dblclick", this.designer.maxOrReturnEditor.bind(this.designer));
if (this.options.showTab) this.page.showTabIm();
},
loadEditor:function(){
this.editor = new MWF.widget.JavascriptEditor(this.areaNode, {"runtime": "service", "option": {"value": this.data.text}});
this.editor = new MWF.widget.JavascriptEditor(this.areaNode, {"runtime": "service"});
this.editor.load(function(){ this.editor.load(function(){
if (this.data.text){ if (this.data.text){
this.editor.editor.setValue(this.data.text); this.editor.editor.setValue(this.data.text);
...@@ -123,7 +136,7 @@ MWF.xApplication.service.AgentDesigner.Agent = new Class({ ...@@ -123,7 +136,7 @@ MWF.xApplication.service.AgentDesigner.Agent = new Class({
defaultText += "********************/\n"; defaultText += "********************/\n";
this.editor.editor.setValue(defaultText); this.editor.editor.setValue(defaultText);
} }
this.editor.addEditorEvent("change", function(){ this.editor.addEditorEvent("change", function(e){
if (!this.isChanged){ if (!this.isChanged){
this.isChanged = true; this.isChanged = true;
this.page.textNode.set("text", " * "+this.page.textNode.get("text")); this.page.textNode.set("text", " * "+this.page.textNode.get("text"));
...@@ -197,8 +210,6 @@ MWF.xApplication.service.AgentDesigner.Agent = new Class({ ...@@ -197,8 +210,6 @@ MWF.xApplication.service.AgentDesigner.Agent = new Class({
this.designer.styleSelectNode.hide(); this.designer.styleSelectNode.hide();
} }
}.bind(this)); }.bind(this));
if (this.options.showTab) this.page.showTabIm();
}, },
showReferenceMenu: function(){ showReferenceMenu: function(){
var pos = this.editor.getCursorPixelPosition(); var pos = this.editor.getCursorPixelPosition();
...@@ -244,7 +255,10 @@ MWF.xApplication.service.AgentDesigner.Agent = new Class({ ...@@ -244,7 +255,10 @@ MWF.xApplication.service.AgentDesigner.Agent = new Class({
} }
}, },
setAreaNodeSize: function(){ setAreaNodeSize: function(){
var size = this.node.getSize(); if( !this.areaNode.offsetParent )return;
//var size = this.node.getSize();
var size = this.node.getComputedSize();
size.y = size.height;
var tabSize = this.tab.tabNodeContainer.getSize(); var tabSize = this.tab.tabNodeContainer.getSize();
var y = size.y - tabSize.y; var y = size.y - tabSize.y;
this.areaNode.setStyle("height", ""+y+"px"); this.areaNode.setStyle("height", ""+y+"px");
......
...@@ -82,21 +82,33 @@ MWF.xApplication.service.InvokeDesigner.Invoke = new Class({ ...@@ -82,21 +82,33 @@ MWF.xApplication.service.InvokeDesigner.Invoke = new Class({
this.setPropertyContent(); this.setPropertyContent();
//this.setIncludeNode(); //this.setIncludeNode();
if (this.editor.editor){ if (this.editor){
this.editor.editor.focus(); this.editor.focus();
//this.editor.editor.navigateFileStart(); }else{
this.loadEditor();
} }
this.setAreaNodeSize();
//if (this.editor.editor){
// this.editor.editor.focus();
//}
}.bind(this)); }.bind(this));
var _self = this;
this.page.addEvent("queryClose", function(){ this.page.addEvent("queryClose", function(){
if (this.autoSaveTimerID) window.clearInterval(this.autoSaveTimerID); if (_self.autoSaveTimerID) window.clearInterval(_self.autoSaveTimerID);
this.showIm();
//this.saveSilence(); //this.saveSilence();
if (this.lisNode) this.lisNode.setStyles(this.designer.css.listInvokeItem); if (_self.lisNode) _self.lisNode.setStyles(_self.designer.css.listInvokeItem);
}.bind(this)); });
this.page.tabNode.addEvent("dblclick", this.designer.maxOrReturnEditor.bind(this.designer)); this.page.tabNode.addEvent("dblclick", this.designer.maxOrReturnEditor.bind(this.designer));
if (this.options.showTab) this.page.showTabIm();
},
loadEditor:function(){
this.editor = new MWF.widget.JavascriptEditor(this.areaNode, {"runtime": "service", "option": {"value": this.data.text}});
this.editor = new MWF.widget.JavascriptEditor(this.areaNode, {"runtime": "service"});
this.editor.load(function(){ this.editor.load(function(){
if (this.data.text){ if (this.data.text){
this.editor.editor.setValue(this.data.text); this.editor.editor.setValue(this.data.text);
...@@ -133,7 +145,7 @@ MWF.xApplication.service.InvokeDesigner.Invoke = new Class({ ...@@ -133,7 +145,7 @@ MWF.xApplication.service.InvokeDesigner.Invoke = new Class({
defaultText += "********************/\n"; defaultText += "********************/\n";
this.editor.editor.setValue(defaultText); this.editor.editor.setValue(defaultText);
} }
this.editor.addEditorEvent("change", function(){ this.editor.addEditorEvent("change", function(e){
if (!this.isChanged){ if (!this.isChanged){
this.isChanged = true; this.isChanged = true;
this.page.textNode.set("text", " * "+this.page.textNode.get("text")); this.page.textNode.set("text", " * "+this.page.textNode.get("text"));
...@@ -205,8 +217,6 @@ MWF.xApplication.service.InvokeDesigner.Invoke = new Class({ ...@@ -205,8 +217,6 @@ MWF.xApplication.service.InvokeDesigner.Invoke = new Class({
this.designer.styleSelectNode.hide(); this.designer.styleSelectNode.hide();
} }
}.bind(this)); }.bind(this));
if (this.options.showTab) this.page.showTabIm();
}, },
showReferenceMenu: function(){ showReferenceMenu: function(){
var pos = this.editor.getCursorPixelPosition(); var pos = this.editor.getCursorPixelPosition();
...@@ -293,7 +303,10 @@ MWF.xApplication.service.InvokeDesigner.Invoke = new Class({ ...@@ -293,7 +303,10 @@ MWF.xApplication.service.InvokeDesigner.Invoke = new Class({
}, },
setAreaNodeSize: function(){ setAreaNodeSize: function(){
var size = this.node.getSize(); if( !this.areaNode.offsetParent )return;
//var size = this.node.getSize();
var size = this.node.getComputedSize();
size.y = size.height;
var tabSize = this.tab.tabNodeContainer.getSize(); var tabSize = this.tab.tabNodeContainer.getSize();
var y = size.y - tabSize.y; var y = size.y - tabSize.y;
this.areaNode.setStyle("height", ""+y+"px"); this.areaNode.setStyle("height", ""+y+"px");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册