Skip to content

Commit

Permalink
make the dock to have none mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ZihengSun committed Mar 3, 2024
1 parent 391bc18 commit f6883a3
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 14 deletions.
4 changes: 4 additions & 0 deletions src/main/resources/static/js/gw.editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ GW.editor = {
$('#prompt-panel-main').height('calc(100% - 55px)')
$('#prompt-panel-main-process-info-code').height('100%')
$('#prompt-panel-main-process-info-history').height('100%')
GW.process.sidepanel.leftDock()
this.isfullscreen = true;
}else {
sidepanel.removeClass('fullscreen');
Expand All @@ -31,10 +32,13 @@ GW.editor = {
$('#prompt-panel-main').height('calc(100% - 105px)')
$('#prompt-panel-main-process-info-code').height('100%')
$('#prompt-panel-main-process-info-history').height('100%')
GW.process.sidepanel.bottomDock()
// editor.refresh();
this.isfullscreen = false;
}

GW.process.util.refreshCodeEditor();

},

switchFullScreen: function(){
Expand Down
25 changes: 18 additions & 7 deletions src/main/resources/static/js/gw.process.js
Original file line number Diff line number Diff line change
Expand Up @@ -1648,18 +1648,29 @@ GW.process = {

},

bottomDock: function(){

GW.process.util.bottomDock("process-code-history-section", "process_code_window", "single-console-content", "dragMe")
noDock: function(){
GW.process.util.noDock("process-code-history-section", "process_code_window", "single-console-content", "dragMe")
GW.process.dockmode = "bottom";
},

bottomDock: function(){
if(GW.process.dockmode != "bottom"){
GW.process.util.bottomDock("process-code-history-section", "process_code_window", "single-console-content", "dragMe")
GW.process.dockmode = "bottom";
}else{
GW.process.util.noDock("process-code-history-section", "process_code_window", "single-console-content", "dragMe")
GW.process.dockmode = "no";
}
},

leftDock: function(){

GW.process.util.leftDock("process-code-history-section", "process_code_window", "single-console-content", "dragMe")
GW.process.dockmode = "left";

if(GW.process.dockmode != "left"){
GW.process.util.leftDock("process-code-history-section", "process_code_window", "single-console-content", "dragMe")
GW.process.dockmode = "left";
}else{
GW.process.util.noDock("process-code-history-section", "process_code_window", "single-console-content", "dragMe")
GW.process.dockmode = "no";
}
},

refreshSearchList: function(){
Expand Down
28 changes: 22 additions & 6 deletions src/main/resources/static/js/gw.process.sidepanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GW.process.sidepanel = {
current_process_id: null,
current_process_name: null,
current_process_category: null,
dockmode: "left",
dockmode: "no",

editor: null,

Expand Down Expand Up @@ -478,19 +478,35 @@ GW.process.sidepanel = {

},

noDock: function(){

GW.process.util.noDock("prompt-panel-code-history-section", "prompt-panel-process_code_window",
"prompt-panel-single-console-content", "prompt-panel-dragMe")
GW.process.sidepanel.dockmode = "no";

},

leftDock: function(){

GW.process.util.leftDock("prompt-panel-code-history-section", "prompt-panel-process_code_window",
if(GW.process.sidepanel.dockmode != "left"){
GW.process.util.leftDock("prompt-panel-code-history-section", "prompt-panel-process_code_window",
"prompt-panel-single-console-content", "prompt-panel-dragMe")
GW.process.sidepanel.dockmode = "left";
GW.process.sidepanel.dockmode = "left";
}else{
GW.process.sidepanel.noDock()
}

},

bottomDock: function(){

GW.process.util.bottomDock("prompt-panel-code-history-section", "prompt-panel-process_code_window",

if(GW.process.sidepanel.dockmode != "bottom"){
GW.process.util.bottomDock("prompt-panel-code-history-section", "prompt-panel-process_code_window",
"prompt-panel-single-console-content", "prompt-panel-dragMe")
GW.process.sidepanel.dockmode = "bottom";
GW.process.sidepanel.dockmode = "bottom";
}else{
GW.process.sidepanel.noDock()
}

},

Expand Down
29 changes: 28 additions & 1 deletion src/main/resources/static/js/gw.process.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,24 +271,49 @@ GW.process.util = {

},

noDock: function(history_section_id, code_window_id, console_content_id, resize_line_id){

var codeContainer = document.getElementById(history_section_id);
var resizerDrag = document.getElementById(resize_line_id);
resizerDrag.style.setProperty("height", "0px");
resizerDrag.style.setProperty("width", "100%");
codeContainer.style.setProperty("display", "block");

var element = document.getElementById(console_content_id);
element.style.setProperty("width", "100%");
element.style.setProperty("height", "0%");
element.style.setProperty("display", "none");

var element = document.getElementById(code_window_id);
element.style.setProperty("width", "100%");
element.style.setProperty("height", "100%");
element.style.setProperty("display", "block");

// activating resizer functionality
GW.process.util.activateVerticalResizer(resize_line_id);
},

bottomDock: function(history_section_id, code_window_id, console_content_id, resize_line_id){

var codeContainer = document.getElementById(history_section_id);
var resizerDrag = document.getElementById(resize_line_id);
resizerDrag.style.setProperty("height", "2px");
resizerDrag.style.setProperty("width", "100%");
codeContainer.style.setProperty("display", "block");
codeContainer.style.setProperty("display", "flow");

var element = document.getElementById(code_window_id);
element.style.setProperty("width", "100%");
element.style.setProperty("height", "60%");
element.style.setProperty("display", "flex");

var element = document.getElementById(console_content_id);
element.style.setProperty("width", "100%");
element.style.setProperty("height", "40%");
element.style.setProperty("display", "flow");

// activating resizer functionality
GW.process.util.activateVerticalResizer(resize_line_id);
$("#"+resize_line_id).css("display", "flow")
},

leftDock: function(history_section_id, code_window_id, console_content_id, resize_line_id){
Expand All @@ -297,6 +322,7 @@ GW.process.util = {

var codeContainer = document.getElementById(history_section_id);
codeContainer.style.setProperty("display", "flex");

var resizerDrag = document.getElementById(resize_line_id);
resizerDrag.style.setProperty("height", "100%");
resizerDrag.style.setProperty("width", "2px");
Expand All @@ -308,6 +334,7 @@ GW.process.util = {
var element = document.getElementById(console_content_id);
element.style.setProperty("width", "60%");
element.style.setProperty("height", "100%");
element.style.setProperty("display", "flow");

// activating resizer functionality
GW.process.util.activateResizer(resize_line_id);
Expand Down

0 comments on commit f6883a3

Please sign in to comment.